Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit d2f3871

Browse filesBrowse files
[DependencyInjection] Mention autoconfiguration through attributes
1 parent cc496e0 commit d2f3871
Copy full SHA for d2f3871

File tree

Expand file treeCollapse file tree

2 files changed

+12
-1
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+12
-1
lines changed

‎controller/upload_file.rst

Copy file name to clipboardExpand all lines: controller/upload_file.rst
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ so Symfony doesn't try to get/set its value from the related entity::
6060

6161
class ProductType extends AbstractType
6262
{
63-
public function buildForm(FormBuilderInterface $builder, array $options)
63+
public function buildForm(FormBuilderInterface $builder, array $options): void
6464
{
6565
$builder
6666
// ...

‎service_container.rst

Copy file name to clipboardExpand all lines: service_container.rst
+11Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -948,6 +948,17 @@ you don't need to do *anything*: the service will be automatically loaded. Then,
948948
implements ``Twig\Extension\ExtensionInterface``. And thanks to ``autowire``, you can even add
949949
constructor arguments without any configuration.
950950

951+
Autconfiguration also works with attributes. Some attributes like
952+
:class:`Symfony\\Component\\Messenger\\Attribute\\AsMessageHandler`,
953+
:class:`Symfony\\Component\\EventDispatcher\\Attribute\\AsEventListener` and
954+
:class:`Symfony\\Component\\Console\\Attribute\\AsCommand` are registered
955+
for autoconfiguration. Any class using these attributes will have tags applied
956+
to them.
957+
958+
.. versionadded:: 5.3
959+
960+
Autoconfiguration through attributes was introduced in Symfony 5.3.
961+
951962
Linting Service Definitions
952963
---------------------------
953964

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.