Skip to content

Commit 18e8189

Browse files
committed
minor #17932 [DependencyInjection] Allow array attributes for services tags (MrYamous)
This PR was squashed before being merged into the 6.2 branch. Discussion ---------- [DependencyInjection] Allow array attributes for services tags Related to #17395 Commits ------- 76791e0 [DependencyInjection] Allow array attributes for services tags
2 parents c99291b + 76791e0 commit 18e8189

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

service_container/tags.rst

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -465,7 +465,7 @@ To answer this, change the service declaration:
465465
466466
MailerSendmailTransport:
467467
tags:
468-
- { name: 'app.mail_transport', alias: 'sendmail' }
468+
- { name: 'app.mail_transport', alias: ['sendmail', 'anotherAlias']}
469469
470470
.. code-block:: xml
471471
@@ -484,7 +484,10 @@ To answer this, change the service declaration:
484484
</service>
485485
486486
<service id="MailerSendmailTransport">
487-
<tag name="app.mail_transport" alias="sendmail"/>
487+
<tag name="app.mail_transport">
488+
<attribute>sendmail</attribute>
489+
<attribute>anotherAlias</attribute>
490+
</tag>
488491
</service>
489492
</services>
490493
</container>
@@ -504,10 +507,14 @@ To answer this, change the service declaration:
504507
;
505508
506509
$services->set(\MailerSendmailTransport::class)
507-
->tag('app.mail_transport', ['alias' => 'sendmail'])
510+
->tag('app.mail_transport', ['alias' => ['sendmail', 'anotherAlias']])
508511
;
509512
};
510513
514+
.. versionadded:: 6.2
515+
516+
Support for attributes as array was introduced in Symfony 6.2.
517+
511518
.. tip::
512519

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

0 commit comments

Comments
 (0)