Skip to content

Commit 254c804

Browse files
committed
Merge branch '7.0' into 7.1
* 7.0: [DependencyInjection] Mention autoconfiguration through attributes
2 parents d9c8e9e + 1bf16f6 commit 254c804

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

service_container.rst

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1027,6 +1027,17 @@ you don't need to do *anything*: the service will be automatically loaded. Then,
10271027
implements ``Twig\Extension\ExtensionInterface``. And thanks to ``autowire``, you can even add
10281028
constructor arguments without any configuration.
10291029

1030+
Autconfiguration also works with attributes. Some attributes like
1031+
:class:`Symfony\\Component\\Messenger\\Attribute\\AsMessageHandler`,
1032+
:class:`Symfony\\Component\\EventDispatcher\\Attribute\\AsEventListener` and
1033+
:class:`Symfony\\Component\\Console\\Attribute\\AsCommand` are registered
1034+
for autoconfiguration. Any class using these attributes will have tags applied
1035+
to them.
1036+
1037+
.. versionadded:: 5.3
1038+
1039+
Autoconfiguration through attributes was introduced in Symfony 5.3.
1040+
10301041
Linting Service Definitions
10311042
---------------------------
10321043

0 commit comments

Comments
 (0)