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
[DependencyInjection] don't move locator tag for service subscriber
Decorators move tags applied to the decorated service to the decorating
service. But this (sometimes) breaks when the decorated service is a
service subscriber, which has the argument for the container explicitly
set.
This mostly works because the locator for the service subscriber is
applied twice. The RegisterServiceSubscriberPass which creates the
locator also sets a binding on the service. The
ResolveServiceSubscriberPass replaces the arguments referencing the
ContainerInterface or ServiceProviderInterface for those services tagged
with the container.service_subscriber.locator tag. So when the argument
isn't provided in the service definition it will automatically be set
using the binding. And in case the argument is set, it will be replaced
by the Resolver pass based on the tag.
But this thus breaks in case a service explicitly sets the
argument (which means the binding isn't applied) and the service being
decorated (meaning the locator tag is "lost"). So add the locator tag
to the list of tags to keep on the original service.
0 commit comments