@@ -27,9 +27,7 @@ with ``console.command``:
27
27
28
28
# app/config/config.yml
29
29
services :
30
- app.command.my_command :
31
- class : AppBundle\Command\MyCommand
32
- tags : [console.command]
30
+ AppBundle\Command\MyCommand : [console.command]
33
31
34
32
.. code-block :: xml
35
33
@@ -41,8 +39,7 @@ with ``console.command``:
41
39
http://symfony.com/schema/dic/services/services-1.0.xsd" >
42
40
43
41
<services >
44
- <service id =" app.command.my_command"
45
- class =" AppBundle\Command\MyCommand" >
42
+ <service id =" AppBundle\Command\MyCommand" >
46
43
<tag name =" console.command" />
47
44
</service >
48
45
</services >
@@ -53,8 +50,7 @@ with ``console.command``:
53
50
// app/config/config.php
54
51
use AppBundle\Command\MyCommand;
55
52
56
- $container
57
- ->register('app.command.my_command', MyCommand::class)
53
+ $container->register(MyCommand::class)
58
54
->addTag('console.command')
59
55
;
60
56
@@ -131,8 +127,7 @@ inject the ``command.default_name`` parameter:
131
127
command.default_name : Javier
132
128
133
129
services :
134
- app.command.my_command :
135
- class : AppBundle\Command\MyCommand
130
+ AppBundle\Command\MyCommand :
136
131
arguments : ["%command.default_name%"]
137
132
tags : [console.command]
138
133
@@ -150,8 +145,7 @@ inject the ``command.default_name`` parameter:
150
145
</parameters >
151
146
152
147
<services >
153
- <service id =" app.command.my_command"
154
- class =" AppBundle\Command\MyCommand" >
148
+ <service class =" AppBundle\Command\MyCommand" >
155
149
<argument >%command.default_name%</argument >
156
150
<tag name =" console.command" />
157
151
</service >
@@ -166,7 +160,7 @@ inject the ``command.default_name`` parameter:
166
160
$container->setParameter('command.default_name', 'Javier');
167
161
168
162
$container
169
- ->register('app.command.my_command', MyCommand::class)
163
+ ->register(MyCommand::class)
170
164
->setArguments(array('%command.default_name%'))
171
165
->addTag('console.command')
172
166
;
0 commit comments