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

Add Attributes to inject scalar definitions & tags #307

Open
rustamwin opened this issue Aug 29, 2022 · 1 comment
Open

Add Attributes to inject scalar definitions & tags #307

rustamwin opened this issue Aug 29, 2022 · 1 comment

Comments

@rustamwin
Copy link
Member

public function foo(#[Inject('scalar')] $scalar, #[Tags('messageSource')] $messageSources)
{
    // $scalar is an alternative to $container->get('scalar')
    // $messageSources is an alternative to $container->get('#messageSource')
}

Can be also used for class properties.

@rustamwin rustamwin added the type:feature New feature label Aug 29, 2022
@samdark
Copy link
Member

samdark commented Aug 29, 2022

Is scalar a concrete key there? Overall, that ties the code in question to this particular implementation of DI container. I'm not sure it is a great idea.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants