@@ -363,19 +363,18 @@ If you register this as a service, you now have *two* services that implement th
363363which one to use. Remember, autowiring isn't magic; it looks for a service
364364whose id matches the type-hint. So you need to choose one by creating an alias
365365from the type to the correct service id (see :ref: `autowiring-interface-alias `).
366- Additionally, you can define several named aliases if you want to use
366+ Additionally, you can define several named autowiring aliases if you want to use
367367one implementation in some cases, and another implementation in some
368368other cases.
369369
370-
371370For instance, you may want to use by default the ``Rot13Transformer ``
372371implementation by default when the ``TransformerInterface `` interface is
373372type hinted, but use the ``UppercaseTransformer `` implementation in some
374373specific cases. To do so, you can create a normal alias from the
375374``TransformerInterface `` interface to ``Rot13Transformer ``, and then
376- create a *named alias * from a special string containing the interface
377- followed by a variable name matching the one you use when doing the
378- injection::
375+ create a *named autowiring alias * from a special string containing the
376+ interface followed by a variable name matching the one you use when doing
377+ the injection::
379378
380379 namespace App\Service;
381380
@@ -423,9 +422,8 @@ injection::
423422 # the Rot13Transformer will be passed as the $transformer argument
424423 autowire : true
425424
426- # If you wanted to choose the non-default service and
427- # do not want to use a named alias, wire it manually
428- # arguments:
425+ # If you wanted to choose the non-default service and do not
426+ # want to use a named autowiring alias, wire it manually:
429427 # $transformer: '@App\Util\UppercaseTransformer'
430428 # ...
431429
@@ -484,7 +482,7 @@ under the arguments key.
484482
485483.. versionadded :: 4.2
486484
487- Named aliases have been introduced in Symfony 4.2.
485+ Named autowiring aliases have been introduced in Symfony 4.2.
488486
489487Fixing Non-Autowireable Arguments
490488---------------------------------
0 commit comments