Skip to content

Commit 76791e0

Browse files
MrYamousjaviereguiluz
authored andcommitted
[DependencyInjection] Allow array attributes for services tags
1 parent cbc6ad5 commit 76791e0

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

service_container/tags.rst

+10-3
Original file line numberDiff line numberDiff line change
@@ -424,7 +424,7 @@ To answer this, change the service declaration:
424424
425425
MailerSendmailTransport:
426426
tags:
427-
- { name: 'app.mail_transport', alias: 'sendmail' }
427+
- { name: 'app.mail_transport', alias: ['sendmail', 'anotherAlias']}
428428
429429
.. code-block:: xml
430430
@@ -443,7 +443,10 @@ To answer this, change the service declaration:
443443
</service>
444444
445445
<service id="MailerSendmailTransport">
446-
<tag name="app.mail_transport" alias="sendmail"/>
446+
<tag name="app.mail_transport">
447+
<attribute>sendmail</attribute>
448+
<attribute>anotherAlias</attribute>
449+
</tag>
447450
</service>
448451
</services>
449452
</container>
@@ -463,10 +466,14 @@ To answer this, change the service declaration:
463466
;
464467
465468
$services->set(\MailerSendmailTransport::class)
466-
->tag('app.mail_transport', ['alias' => 'sendmail'])
469+
->tag('app.mail_transport', ['alias' => ['sendmail', 'anotherAlias']])
467470
;
468471
};
469472
473+
.. versionadded:: 6.2
474+
475+
Support for attributes as array was introduced in Symfony 6.2.
476+
470477
.. tip::
471478

472479
In YAML format, you may provide the tag as a simple string as long as

0 commit comments

Comments
 (0)