[DependencyInjection] Fix autowiring tagged arguments from attributes#43579
[DependencyInjection] Fix autowiring tagged arguments from attributes#43579nicolas-grekas merged 1 commit intosymfony:5.3from
Conversation
|
Hey! I see that this is your first PR. That is great! Welcome! Symfony has a contribution guide which I suggest you to read. In short:
Review the GitHub status checks of your pull request and try to solve the reported issues. If some tests are failing, try to see if they are failing because of this change. When two Symfony core team members approve this change, it will be merged and you will become an official Symfony contributor! I am going to sit back now and wait for the reviews. Cheers! Carsonbot |
src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php
Outdated
Show resolved
Hide resolved
6a33b9b to
b064cca
Compare
|
Thanks for the PR, I think moving attributes resolution from Yet I see three issues that should be fixed to me:
I think all 3 issues can be solved by patching |
|
Thanks for the comments ! Is it possible to target 5.3 since the When you say that you would hardcode the attributes in the As a side note, I had to change the behavior of |
|
We need to fix this issue in 5.3, and I don't have a better idea.
Yes, I didn't full grasp this part but I'll review more carefully after the rest is fixed :) |
|
@nicolas-grekas I pushed a rework of the branch. It works with the IntegrationTest, but it breaks some tests on the side, mainly because the I'll fix the other tests tomorrow. Also, I noticed that #43386 has been merged on 5.4 only and it's modifying the tags, so conflicts will arise :(. |
src/Symfony/Component/DependencyInjection/Compiler/AttributeAutoconfigurationPass.php
Outdated
Show resolved
Hide resolved
9aa90b8 to
55a39c0
Compare
There was a problem hiding this comment.
While reviewing more carefully, I found that patching AttributeAutoconfigurationPass would not work well with autowiring of @required methods, or with named arguments, etc.
Instead, I pushed a new pass that is dedicated to autowiring tagged arguments from attributes. This pass runs after AutowireRequired*Pass and before ServiceLocatorTagPass, thus fixing all concerns.
42ca1ca to
b2783a7
Compare
|
I figured out an even simpler patch, PR updated. |
b2783a7 to
4c7566f
Compare
|
Thank you @okhoshi. |
Reimplement #40406 with
AttributeAutoconfigurationPassto avoid the BC following the change inCompilerPassordering inPassConfig.Also revert the various fix made in an attempt to recover the BC introduced by #40406.
Note:5.4branch was needed becauseAttributeAutoconfigurationPassis not handling parameters in 5.3To-do: