Answer the question
In order to leave comments, you need to log in
Is it possible to somehow tag services through the implements interface?
Hello everyone,
at the moment I'm tagging services, like this:
services.yaml:
MyNamespace\Service\MyService:
autowire: true
tags:
- {name: app.my_tag}
class MyClass implements MyInterfaceForTagging{
}
Answer the question
In order to leave comments, you need to log in
Yes, starting from version 3.3, examples are in the documentation . In your case it will be:
# app/config/services.yml
services:
_instanceof:
MyNamespace\Service\MyInterfaceForTagging:
tags: ['app.my_tag']
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question