-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
328bbfb
to
ffbdd40
Compare
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
Outdated
Show resolved
Hide resolved
Can this also be added for the PHP DSL loader? Really nice addition! |
ffbdd40
to
d2d59af
Compare
Thanks for the positive feedback! @sstok
|
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? |
@nicolas-grekas friendly ping |
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
Outdated
Show resolved
Hide resolved
src/Symfony/Component/DependencyInjection/Argument/BoundArgument.php
Outdated
Show resolved
Hide resolved
src/Symfony/Component/DependencyInjection/Compiler/ResolveBindingsPass.php
Outdated
Show resolved
Hide resolved
src/Symfony/Component/DependencyInjection/Loader/Configurator/ServicesConfigurator.php
Outdated
Show resolved
Hide resolved
src/Symfony/Component/DependencyInjection/Loader/YamlFileLoader.php
Outdated
Show resolved
Hide resolved
src/Symfony/Component/HttpKernel/DependencyInjection/RegisterControllerArgumentLocatorsPass.php
Outdated
Show resolved
Hide resolved
Ping @przemyslaw-bogusz! Will you have time to check out the tweaks? We can hopefully get this into 4.3! :) |
I will do it tomorrow, so I believe we can close it by the end of the weekend. Hope that's good enough. |
It's great :). Thank you for your work! |
@przemyslaw-bogusz do you have time to finish this or do you want me to take the rest of it ? |
627c437
to
531be07
Compare
531be07
to
c960bdb
Compare
@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. |
c960bdb
to
35bf420
Compare
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
Congrats! Thank you SO much @przemyslaw-bogusz!! |
Workaround until 4.2.6: make sure that at least one service consumes each dependency mentioned in _defaults / bind |
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. |
@scott-r-lindsey I am not sure, if I understand you correctly, but the whole purpose of |
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.