Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 94ce872

Browse files
committed
Merge branch '5.4' into 6.3
* 5.4: [DependencyInjection] Mention autoconfiguration through attributes
2 parents 6b8b22c + 2164b05 commit 94ce872

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
@@ -1031,6 +1031,17 @@ you don't need to do *anything*: the service will be automatically loaded. Then,
10311031
implements ``Twig\Extension\ExtensionInterface``. And thanks to ``autowire``, you can even add
10321032
constructor arguments without any configuration.
10331033

1034+
Autconfiguration also works with attributes. Some attributes like
1035+
:class:`Symfony\\Component\\Messenger\\Attribute\\AsMessageHandler`,
1036+
:class:`Symfony\\Component\\EventDispatcher\\Attribute\\AsEventListener` and
1037+
:class:`Symfony\\Component\\Console\\Attribute\\AsCommand` are registered
1038+
for autoconfiguration. Any class using these attributes will have tags applied
1039+
to them.
1040+
1041+
.. versionadded:: 5.3
1042+
1043+
Autoconfiguration through attributes was introduced in Symfony 5.3.
1044+
10341045
Linting Service Definitions
10351046
---------------------------
10361047

0 commit comments

Comments
 (0)