Skip to content

Commit 61166c1

Browse files
committed
minor #7877 Update some examples using 3.3 features (GuilhemN)
This PR was merged into the 3.3 branch. Discussion ---------- Update some examples using 3.3 features I updated some examples using 3.3 di features, but there is still a lot to do. Commits ------- 04903f7 Update some examples using 3.3 features
2 parents 66f8383 + 04903f7 commit 61166c1

File tree

5 files changed

+57
-130
lines changed

5 files changed

+57
-130
lines changed

console/commands_as_services.rst

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,7 @@ with ``console.command``:
2727
2828
# app/config/config.yml
2929
services:
30-
app.command.my_command:
31-
class: AppBundle\Command\MyCommand
32-
tags: [console.command]
30+
AppBundle\Command\MyCommand: [console.command]
3331
3432
.. code-block:: xml
3533
@@ -41,8 +39,7 @@ with ``console.command``:
4139
http://symfony.com/schema/dic/services/services-1.0.xsd">
4240
4341
<services>
44-
<service id="app.command.my_command"
45-
class="AppBundle\Command\MyCommand">
42+
<service id="AppBundle\Command\MyCommand">
4643
<tag name="console.command" />
4744
</service>
4845
</services>
@@ -54,8 +51,7 @@ with ``console.command``:
5451
// app/config/config.php
5552
use AppBundle\Command\MyCommand;
5653
57-
$container
58-
->register('app.command.my_command', MyCommand::class)
54+
$container->register(MyCommand::class)
5955
->addTag('console.command')
6056
;
6157
@@ -132,8 +128,7 @@ inject the ``command.default_name`` parameter:
132128
command.default_name: Javier
133129
134130
services:
135-
app.command.my_command:
136-
class: AppBundle\Command\MyCommand
131+
AppBundle\Command\MyCommand:
137132
arguments: ["%command.default_name%"]
138133
tags: [console.command]
139134
@@ -151,8 +146,7 @@ inject the ``command.default_name`` parameter:
151146
</parameters>
152147
153148
<services>
154-
<service id="app.command.my_command"
155-
class="AppBundle\Command\MyCommand">
149+
<service class="AppBundle\Command\MyCommand">
156150
<argument>%command.default_name%</argument>
157151
<tag name="console.command" />
158152
</service>
@@ -168,7 +162,7 @@ inject the ``command.default_name`` parameter:
168162
$container->setParameter('command.default_name', 'Javier');
169163
170164
$container
171-
->register('app.command.my_command', MyCommand::class)
165+
->register(MyCommand::class)
172166
->setArguments(array('%command.default_name%'))
173167
->addTag('console.command')
174168
;

form/type_guesser.rst

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -188,8 +188,7 @@ and tag it with ``form.type_guesser``:
188188
services:
189189
# ...
190190
191-
AppBundle\Form\TypeGuesser\PHPDocTypeGuesser:
192-
tags: [form.type_guesser]
191+
AppBundle\Form\TypeGuesser\PHPDocTypeGuesser: [form.type_guesser]
193192
194193
.. code-block:: xml
195194

0 commit comments

Comments
 (0)