Skip to content

Commit 6d87827

Browse files
committed
fixing standard and fixing missing argument in php+xml formats
1 parent 6b1c640 commit 6d87827

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

cookbook/console/commands_as_services.rst

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ inject the ``command.default_name`` parameter:
135135
services:
136136
app.command.my_command:
137137
class: AppBundle\Command\MyCommand
138-
arguments: ['%command.default_name%']
138+
arguments: ["%command.default_name%"]
139139
tags:
140140
- { name: console.command }
141141
@@ -155,6 +155,7 @@ inject the ``command.default_name`` parameter:
155155
<services>
156156
<service id="app.command.my_command"
157157
class="AppBundle\Command\MyCommand">
158+
<argument>%command.default_name%</argument>
158159
<tag name="console.command" />
159160
</service>
160161
</services>
@@ -168,8 +169,9 @@ inject the ``command.default_name`` parameter:
168169
$container
169170
->register(
170171
'app.command.my_command',
171-
'AppBundle\Command\MyCommand'
172+
'AppBundle\Command\MyCommand',
172173
)
174+
->setArguments(array('%command.default_name%'))
173175
->addTag('console.command')
174176
;
175177

0 commit comments

Comments
 (0)