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
If we use an abstract service and extend a class from it with an alias in the name and specifying the class attribute, and write the tags attribute in the descendant, then when building the cache after calling the findTaggedServiceIds method, it returns duplicated tags: one for the alias and one for the full class path.
I used vendor/enqueue/enqueue/Symfony/Client/DependencyInjection/BuildTopicSubscriberRoutesPass.php (file of enqueue/enqueue package) for reproducing it, but it does not big matter, it just my case.
if I understand the issue correctly, this is similar to #48019 which was tried to be fixed in #48027 but was later reverted (see #48482) as it led to other issues (see #48388)
Symfony version(s) affected
6.0
Description
If we use an abstract service and extend a class from it with an alias in the name and specifying the class attribute, and write the tags attribute in the descendant, then when building the cache after calling the findTaggedServiceIds method, it returns duplicated tags: one for the alias and one for the full class path.
How to reproduce
services.yaml
I used vendor/enqueue/enqueue/Symfony/Client/DependencyInjection/BuildTopicSubscriberRoutesPass.php (file of enqueue/enqueue package) for reproducing it, but it does not big matter, it just my case.
In result i have:
Which creates an incorrect amount of $routeCollection, because there is no information in the result data that it is the same class.
But if we did not use aliases:
services.yaml
Then count of tagged classes will be correct:
May be its not fault of abstract class. But i did not checked it fully.
Possible Solution
Some how exclude duplicates and leave only tagged aliases.
Additional Context
No response
The text was updated successfully, but these errors were encountered: