Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
[DependencyInjection] Add iterable to possible binding type#44979
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
nicolas-grekas commentedJan 11, 2022
Please add a test case that covers the situation. |
sveneld commentedJan 11, 2022
Add test for this case |
sveneld commentedJan 12, 2022
@nicolas-grekas done |
| publicfunctiontestIterableBindingTypehint() | ||
| { | ||
| spl_autoload_register( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
is this required? if not let's remove it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
it's required to show the problem, if this function will run it will mean that code of ResolveBindingsPass.php working incorrect
| $pass =newResolveBindingsPass(); | ||
| $pass->process($container); | ||
| $this->assertInstanceOf( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
on one line please
| ); | ||
| $container =newContainerBuilder(); | ||
| $bindings = [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
the variable could be removed
nicolas-grekas left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
(for 4.4)
nicolas-grekas commentedJan 12, 2022
Thank you@sveneld. |
This PR was submitted for the 5.4 branch but it was merged into the 4.4 branch instead.Discussion----------[DependencyInjection] Fix type binding| Q | A| ------------- | ---| Branch? | 5.4| Bug fix? | yes| License | MITIf $type is a scalar compiler pass should not check it in function is_subclass_of($type, \UnitEnum::class), because is_subclass_of trying to autoload class with name array, string, etc.Related to#44979Commits-------3754018 Fix type binding
Uh oh!
There was an error while loading.Please reload this page.
When iterable type is set in binding like in examplehttps://symfony.com/doc/current/service_container.html#binding-arguments-by-name-or-type, system tries to autoload class iterable here src/Symfony/Component/DependencyInjection/Compiler/ResolveBindingsPass.php:137