@@ -553,16 +553,16 @@ If the argument is named ``$shoutyTransformer``,
553
553
But, you can also manually wire any *other * service by specifying the argument
554
554
under the arguments key.
555
555
556
- Another possibility is to use the ``#[Target] `` attribute. By using this attribute
557
- on the argument you want to autowire, you can define exactly which service to inject
558
- by passing the name of the argument used in the named alias. Thanks to this , you're able
559
- to have multiple services implementing the same interface and keep the argument name
560
- decorrelated of any implementation name (like shown in the example above).
556
+ Another option is to use the ``#[Target] `` attribute. By adding this attribute
557
+ to the argument you want to autowire, you can specify which service to inject by
558
+ passing the name of the argument used in the named alias. This way , you can have
559
+ multiple services implementing the same interface and keep the argument name
560
+ separate from any implementation name (like shown in the example above).
561
561
562
562
.. warning ::
563
563
564
- The ``#[Target] `` attribute only accepts the name of the argument used in the named
565
- alias, it **
8000
does not ** accept service ids or service aliases.
564
+ The ``#[Target] `` attribute only accepts the name of the argument used in the
565
+ named alias; it **does not ** accept service ids or service aliases.
566
566
567
567
Suppose you want to inject the ``App\Util\UppercaseTransformer `` service. You would use
568
568
the ``#[Target] `` attribute by passing the name of the ``$shoutyTransformer `` argument::
@@ -584,8 +584,10 @@ the ``#[Target]`` attribute by passing the name of the ``$shoutyTransformer`` ar
584
584
}
585
585
}
586
586
587
- Since the ``#[Target] `` attribute normalizes the string passed to it to its camelCased form,
588
- name variations such as ``shouty.transformer `` also work.
587
+ .. tip ::
588
+
589
+ Since the ``#[Target] `` attribute normalizes the string passed to it to its
590
+ camelCased form, name variations (e.g. ``shouty.transformer ``) also work.
589
591
590
592
.. note ::
591
593
0 commit comments