Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support class name references (aliases) in Container configuration #96

Merged
merged 2 commits into from
Dec 13, 2021

Conversation

clue
Copy link
Owner

@clue clue commented Dec 12, 2021

This changeset adds support for class name references (aliases) in the Container configuration. This allows us to fine-tune the autowiring behavior and explicitly overwrite autowiring defaults for more advanced use cases. This does not otherwise break existing APIs, so this is a pure feature addition.

<?php

use FrameworkX\Container;
use Psr\Http\Message\ResponseInterface;
use React\Cache\ArrayCache;
use React\Cache\CacheInterface;
use React\Http\Message\Response;

// …

$container = new Container([
    ResponseInterface::class => Response::class,
    CacheInterface::class => function () {
        return ArrayCache::class;
    }
]);

// …

Builds on top of #95

@clue clue added the new feature New feature or request label Dec 12, 2021
@clue clue requested a review from SimonFrings December 12, 2021 18:51
@clue clue force-pushed the container-class-names branch from 52e78c6 to 010c23e Compare December 13, 2021 07:32
@SimonFrings SimonFrings merged commit 94b5526 into clue:main Dec 13, 2021
@clue clue deleted the container-class-names branch December 13, 2021 09:56
@SimonFrings SimonFrings added this to the v0.6.0 milestone Mar 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants