You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
bug symfony#58000 [DependencyInjection] Fix issue between decorator and service locator index (lyrixx)
This PR was merged into the 5.4 branch.
Discussion
----------
[DependencyInjection] Fix issue between decorator and service locator index
| Q | A
| ------------- | ---
| Branch? | 5.4
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Issues | Fixsymfony#53174
| License | MIT
This PR is not finished yet. I want to gather feedback before writing tests.
To explain what is wrong, I create a [reproducer](https://github.com/lyrixx/test/tree/symfony/symfony/pull/58000).
Basically, when we decorates a services, we replace the old ID with a new ID in the DIC.
Then, when we build a service locator, we use the new ID. This is really not handy because our code
is dependant on the new name or old name, depending if the decorator is here or not!
This issue discribe very well the issue: symfony#53174
So in this PR, I save the original ID in the decorator definition. Then I used this initial ID to build the `$index` of the
service locator.
---
With this PR and the reproducer, I got what would be expected

* Original ID in the locator
* But we retrieve the decorated
* Works well with decorator of decorator (etc)
Commits
-------
b2e8399 [DependencyInjection] Fix issue between decorator and service locator index
0 commit comments