Skip to content

Commit 49d73c0

Browse files
committed
[DependencyInjection] Allow multiple #[AsDecorator] attributes
1 parent 004620e commit 49d73c0

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

β€Žservice_container/service_decoration.rst

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,16 @@ but keeps a reference of the old one as ``.inner``:
123123
->decorate(Mailer::class);
124124
};
125125
126+
.. tip::
127+
128+
You can apply multiple ``#[AsDecorator]`` attributes to the same class to
129+
decorate multiple services with it.
130+
131+
.. versionadded:: 7.4
132+
133+
The feature to allow multiple ``#[AsDecorator]`` attributes was introduced
134+
in Symfony 7.4.
135+
126136
The ``decorates`` option tells the container that the ``App\DecoratingMailer``
127137
service replaces the ``App\Mailer`` service. If you're using the
128138
:ref:`default services.yaml configuration <service-container-services-load-example>`,

0 commit comments

Comments
 (0)