Skip to content

Commit ff01c14

Browse files
committed
Merge branch '5.4' into 6.3
* 5.4: Ref for autowiring alias
2 parents 8f966c0 + 32770b2 commit ff01c14

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

service_container.rst

+3-1
Original file line numberDiff line numberDiff line change
@@ -1368,7 +1368,9 @@ admin email. In this case, each needs to have a unique service id:
13681368
In this case, *two* services are registered: ``site_update_manager.superadmin``
13691369
and ``site_update_manager.normal_users``. Thanks to the alias, if you type-hint
13701370
``SiteUpdateManager`` the first (``site_update_manager.superadmin``) will be passed.
1371-
If you want to pass the second, you'll need to :ref:`manually wire the service <services-wire-specific-service>`.
1371+
1372+
If you want to pass the second, you'll need to :ref:`manually wire the service <services-wire-specific-service>`
1373+
or to create a named ref:`autowiring alias <autowiring-alias>`.
13721374

13731375
.. caution::
13741376

service_container/autowiring.rst

+2
Original file line numberDiff line numberDiff line change
@@ -417,6 +417,8 @@ Additionally, you can define several named autowiring aliases if you want to use
417417
one implementation in some cases, and another implementation in some
418418
other cases.
419419

420+
.. _autowiring-alias:
421+
420422
For instance, you may want to use the ``Rot13Transformer``
421423
implementation by default when the ``TransformerInterface`` interface is
422424
type hinted, but use the ``UppercaseTransformer`` implementation in some

0 commit comments

Comments
 (0)