File tree 1 file changed +9
-3
lines changed
Filter options
1 file changed +9
-3
lines changed
Original file line number Diff line number Diff line change @@ -515,7 +515,7 @@ attribute to the locator service defining the name of this custom method:
515
515
# ...
516
516
517
517
App\HandlerCollection :
518
- arguments : [!tagged_locator { tag: 'app.handler', default_index_method: 'myOwnMethodName' }]
518
+ arguments : [!tagged_locator { tag: 'app.handler', index_by: 'key', default_index_method: 'myOwnMethodName' }]
519
519
520
520
.. code-block :: xml
521
521
@@ -531,7 +531,7 @@ attribute to the locator service defining the name of this custom method:
531
531
<!-- ... -->
532
532
533
533
<service id =" App\HandlerCollection" >
534
- <argument type =" tagged_locator" tag =" app.handler" default-index-method =" myOwnMethodName" />
534
+ <argument type =" tagged_locator" tag =" app.handler" index-by = " key " default-index-method =" myOwnMethodName" />
535
535
</service >
536
536
</services >
537
537
</container >
@@ -544,10 +544,16 @@ attribute to the locator service defining the name of this custom method:
544
544
return function(ContainerConfigurator $configurator) {
545
545
$configurator->services()
546
546
->set(App\HandlerCollection::class)
547
- ->args([tagged_locator('app.handler', null , 'myOwnMethodName')])
547
+ ->args([tagged_locator('app.handler', 'key' , 'myOwnMethodName')])
548
548
;
549
549
};
550
550
551
+ .. note ::
552
+
553
+ Since code should not be responsible for defining how the locators are
554
+ going to be used, a configuration key (``key `` in the example above) must
555
+ be set so the custom method may be called as a fallback.
556
+
551
557
Service Subscriber Trait
552
558
------------------------
553
559
You can’t perform that action at this time.
0 commit comments