Can't use non-fqcn service id when using ServiceSubscriberInterface. Why? #47344
Answered
by
MatTheCat
javaDeveloperKid
asked this question in
Q&A
-
When using ServiceSubscriberInterface I can't use the non-fqcn service id. Why? What's the limitation? The following: public static function getSubscribedServices()
{
return [
'app.service.my_service'
];
} throws: |
Beta Was this translation helpful? Give feedback.
Answered by
MatTheCat
Aug 20, 2022
Replies: 1 comment
-
From the interface you mention:
You’ll have to tag your subscriber yourself: https://symfony.com/doc/current/service_container/service_subscribers_locators.html#aliased-services |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
javaDeveloperKid
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
From the interface you mention:
app.service.my_service
is a service name, not type.You’ll have to tag your subscriber yourself: https://symfony.com/doc/current/service_container/service_subscribers_locators.html#aliased-services