Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
[DI] Fix not working if only "default_index_method" used#39203
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
[DI] Fix not working if only "default_index_method" used#39203
Uh oh!
There was an error while loading.Please reload this page.
Conversation
src/Symfony/Component/DependencyInjection/Compiler/PriorityTaggedServiceTrait.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
src/Symfony/Component/DependencyInjection/Compiler/PriorityTaggedServiceTrait.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
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.
I updated the implementation to improve the error messages and fix the behavior specifically when an index method is defined.
Tests are now green.
malteschlueter commentedDec 9, 2020
Thank you very much for your support@nicolas-grekas! |
fabpot commentedDec 10, 2020
Thank you@malteschlueter. |
The default index method wasn't used if the "index_by" attribute is missing. The documentation is showing an example, seehttps://symfony.com/doc/current/service_container/tags.html#tagged-services-with-index.
This problem also appears in symfony 5.
I created two example projects, the first in the current behaviour and the second with my bugfix branch.
Current 4.4:https://github.com/malteschlueter/symfony-reproducers/blob/bugfix/dependency-injection-default-index-method-not-working--not-fixed/tests/HandlerCollectionTest.php
This bugfix branch:https://github.com/malteschlueter/symfony-reproducers/blob/bugfix/dependency-injection-default-index-method-not-working--with-fix/tests/HandlerCollectionTest.php