File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -117,6 +117,29 @@ If you want to apply tags automatically for your own services, use the
117117 ->tag('app.custom_tag');
118118 };
119119
120+ It is also possible to use the ``#[AutoconfigureTag] `` attribute directly on the
121+ base class or interface::
122+
123+ // src/Security/CustomInterface.php
124+ namespace App\Security;
125+
126+ use Symfony\Component\DependencyInjection\Attribute\AutoconfigureTag;
127+
128+ #[AutoconfigureTag('app.custom_tag')]
129+ interface CustomInterface
130+ {
131+ // ...
132+ }
133+
134+ .. tip ::
135+
136+ If you need more capabilities to autoconfigure instances of your base class
137+ like their laziness, their bindings or their calls for example, you may rely
138+ on the :class: `Symfony\\ Component\\ DependencyInjection\\ Attribute\\ Autoconfigure ` attribute.
139+
140+ .. versionadded :: 5.3
141+
142+ The ``#[Autoconfigure] `` and ``#[AutoconfigureTag] `` attributes were introduced in Symfony 5.3.
120143
121144For more advanced needs, you can define the automatic tags using the
122145:method: `Symfony\\ Component\\ DependencyInjection\\ ContainerBuilder::registerForAutoconfiguration ` method.
You can’t perform that action at this time.
0 commit comments