Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitfa19770

Browse files
committed
Fix service locator declaration
1 parentf5e4942 commitfa19770

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

‎service_container/service_locators.rst‎

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -91,10 +91,11 @@ option to include as many services as needed to it and add the
9191
9292
app.command_handler_locator:
9393
class:Symfony\Component\DependencyInjection\ServiceLocator
94-
arguments:
95-
AppBundle\FooCommand:'@app.command_handler.foo'
96-
AppBundle\BarCommand:'@app.command_handler.bar'
9794
tags:['container.service_locator']
95+
arguments:
96+
-
97+
AppBundle\FooCommand:'@app.command_handler.foo'
98+
AppBundle\BarCommand:'@app.command_handler.bar'
9899
99100
..code-block::xml
100101
@@ -106,8 +107,10 @@ option to include as many services as needed to it and add the
106107
<services>
107108
108109
<serviceid="app.command_handler_locator"class="Symfony\Component\DependencyInjection\ServiceLocator">
109-
<argumentkey="AppBundle\FooCommand"type="service"id="app.command_handler.foo" />
110-
<argumentkey="AppBundle\BarCommand"type="service"id="app.command_handler.bar" />
110+
<argumenttype="collection">
111+
<argumentkey="AppBundle\FooCommand"type="service"id="app.command_handler.foo" />
112+
<argumentkey="AppBundle\BarCommand"type="service"id="app.command_handler.bar" />
113+
</argument>
111114
<tagname="container.service_locator" />
112115
</service>
113116
@@ -124,10 +127,10 @@ option to include as many services as needed to it and add the
124127
$container
125128
->register('app.command_handler_locator', ServiceLocator::class)
126129
->addTag('container.service_locator')
127-
->setArguments(array(
130+
->setArguments(array(array(
128131
'AppBundle\FooCommand' => new Reference('app.command_handler.foo'),
129132
'AppBundle\BarCommand' => new Reference('app.command_handler.bar'),
130-
))
133+
)))
131134
;
132135
133136
..note::

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp