Skip to content

Commit a6cedd8

Browse files
committed
feature #21380 [DependencyInjection] Allow multiple #[AsDecorator] attributes (javiereguiluz)
This PR was merged into the 7.4 branch. Discussion ---------- [DependencyInjection] Allow multiple `#[AsDecorator]` attributes Fixes #21340. Commits ------- 49d73c0 [DependencyInjection] Allow multiple #[AsDecorator] attributes
2 parents 878c3fc + 49d73c0 commit a6cedd8

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)