-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
How to configure named argument with variadics and autowire in YAML? #24935
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
Comments
I don't think that's supported, just because nobody made it to work. You could be the one :) |
Ok, i can try to do it. Shall i introduce new tag |
Reflection, as it's already used, so should be just a new case to handle in |
I think that make sense. |
…amed arguments (PabloKowalczyk) This PR was squashed before being merged into the 4.1-dev branch (closes #24937). Discussion ---------- [DependencyInjection] Added support for variadics in named arguments | Q | A | ------------- | --- | Branch? | 4.1 | Bug fix? | no | New feature? | yes | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #24935 | License | MIT Commits ------- b5c0e89 [DependencyInjection] Added support for variadics in named arguments
Would be great if this could work with |
Hello,
I'm wondering how to configure named argument with variadics parameter and autowire.
Please look at these example classes:
class Bar { }
As we can see, class
Foo
has$bars
constructor param as a variadic.Without autowire i can configure it as presented below:
Now, i would like to use
autowire
feature, but i don't know how to configure it.Below config doesn't work - exception
Type error: Argument 2 passed to Foo::__construct() must be an instance of Bar, array given
:Below config works but only last service is injected:
Is there any way to configure it properly?
Thanks.
The text was updated successfully, but these errors were encountered: