File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Expand file tree Collapse file tree 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:
515515 # ...
516516
517517 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' }]
519519
520520 .. code-block :: xml
521521
@@ -531,7 +531,7 @@ attribute to the locator service defining the name of this custom method:
531531 <!-- ... -->
532532
533533 <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" />
535535 </service >
536536 </services >
537537 </container >
@@ -544,10 +544,16 @@ attribute to the locator service defining the name of this custom method:
544544 return function(ContainerConfigurator $configurator) {
545545 $configurator->services()
546546 ->set(App\HandlerCollection::class)
547- ->args([tagged_locator('app.handler', null , 'myOwnMethodName')])
547+ ->args([tagged_locator('app.handler', 'key' , 'myOwnMethodName')])
548548 ;
549549 };
550550
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+
551557Service Subscriber Trait
552558------------------------
553559
You can’t perform that action at this time.
0 commit comments