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 bad error message for unused bind under _defaults#29935
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
328bbfb toffbdd40Compare
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.
Looks nice!
That should target master to me, it's more an improvement than a bug fix.
Tests fail because composer.json files need to bump the minimum supported version of di, for http-kernel.
src/Symfony/Component/DependencyInjection/Compiler/ResolveBindingsPass.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
sstok commentedJan 25, 2019
Can this also be added for the PHP DSL loader? Really nice addition! |
ffbdd40 tod2d59afCompareprzemyslaw-bogusz commentedJan 26, 2019
Thanks for the positive feedback! @sstok
|
przemyslaw-bogusz commentedFeb 12, 2019
Does it mean I have to make changes in composer.json in my repository? It seems to be identical with the one from Symfony's repository? |
fabpot commentedMar 4, 2019
@nicolas-grekas friendly ping |
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.
Looks nice, sorry for the late review, here are some comments.
src/Symfony/Component/DependencyInjection/Argument/BoundArgument.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
src/Symfony/Component/DependencyInjection/Argument/BoundArgument.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
src/Symfony/Component/DependencyInjection/Compiler/ResolveBindingsPass.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
src/Symfony/Component/DependencyInjection/Loader/Configurator/ServicesConfigurator.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
src/Symfony/Component/DependencyInjection/Loader/YamlFileLoader.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
src/Symfony/Component/HttpKernel/DependencyInjection/RegisterControllerArgumentLocatorsPass.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
weaverryan commentedApr 5, 2019
Ping@przemyslaw-bogusz! Will you have time to check out the tweaks? We can hopefully get this into 4.3! :) |
przemyslaw-bogusz commentedApr 5, 2019
I will do it tomorrow, so I believe we can close it by the end of the weekend. Hope that's good enough. |
weaverryan commentedApr 6, 2019
It's great :). Thank you for your work! |
Simperfit commentedApr 6, 2019
@przemyslaw-bogusz do you have time to finish this or do you want me to take the rest of it ? |
627c437 to531be07Compare531be07 toc960bdbCompareprzemyslaw-bogusz commentedApr 6, 2019
@nicolas-grekas,@weaverryan Thank you for your patience. If you have any additional comments, please let me know. I hope we will also be able to close#29944. |
nicolas-grekas commentedApr 7, 2019
Thank you@przemyslaw-bogusz. |
…ults (przemyslaw-bogusz)This PR was merged into the 4.3-dev branch.Discussion----------[DI] Fix bad error message for unused bind under _defaults| Q | A| ------------- | ---| Branch? | master| Bug fix? | yes| New feature? | yes| BC breaks? | no| Deprecations? | no| Tests pass? | yes| Fixed tickets |#27828| License | MIT**Sidenote**: I originally included the fix in#29897, but I decided to close the previous PR and divide it into two separate PRs for clarity.**Description:**With this fix, the message regarding an unused bind will have a clear information about the type of the bind (defined under __defaults_, __instanceof_ or _per service_), as well as the name of the file, in which it was configurated. It's for, both, YAML and XML configurations.For the core team, please note, that the fix assumes a possibility of definings binds under __instanceof_, which was introduced in#27806. But since fixes are merged into other branches, I thought that it might be necessary to inlude this possibility. If this case requires making separate fixes for different branches, I will gladly do it.Commits-------35bf420 [DI] Fix bad error message for unused bind under _defaults
weaverryan commentedApr 8, 2019
Congrats! Thank you SO much@przemyslaw-bogusz!! |
scott-r-lindsey commentedApr 9, 2019
Workaround until 4.2.6: make sure that at least one service consumes each dependency mentioned in _defaults / bind |
weaverryan commentedApr 9, 2019
That will still be the case after this PR. This is just to correct the error message, which was misleading. I think#29944 might be what you’re looking for. |
przemyslaw-bogusz commentedApr 9, 2019
@scott-r-lindsey I am not sure, if I understand you correctly, but the whole purpose of |
Uh oh!
There was an error while loading.Please reload this page.
Sidenote: I originally included the fix in#29897, but I decided to close the previous PR and divide it into two separate PRs for clarity.
Description:
With this fix, the message regarding an unused bind will have a clear information about the type of the bind (defined under _defaults, _instanceof orper service), as well as the name of the file, in which it was configurated. It's for, both, YAML and XML configurations.
For the core team, please note, that the fix assumes a possibility of definings binds under _instanceof, which was introduced in#27806. But since fixes are merged into other branches, I thought that it might be necessary to inlude this possibility. If this case requires making separate fixes for different branches, I will gladly do it.