Skip to content

Update some examples using 3.3 features #7877

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 21, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 6 additions & 12 deletions console/commands_as_services.rst
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,7 @@ with ``console.command``:

# app/config/config.yml
services:
app.command.my_command:
class: AppBundle\Command\MyCommand
tags: [console.command]
AppBundle\Command\MyCommand: [console.command]

.. code-block:: xml

Expand All @@ -41,8 +39,7 @@ with ``console.command``:
http://symfony.com/schema/dic/services/services-1.0.xsd">

<services>
<service id="app.command.my_command"
class="AppBundle\Command\MyCommand">
<service id="AppBundle\Command\MyCommand">
<tag name="console.command" />
</service>
</services>
Expand All @@ -53,8 +50,7 @@ with ``console.command``:
// app/config/config.php
use AppBundle\Command\MyCommand;

$container
->register('app.command.my_command', MyCommand::class)
$container->register(MyCommand::class)
->addTag('console.command')
;

Expand Down Expand Up @@ -131,8 +127,7 @@ inject the ``command.default_name`` parameter:
command.default_name: Javier

services:
app.command.my_command:
class: AppBundle\Command\MyCommand
AppBundle\Command\MyCommand:
arguments: ["%command.default_name%"]
tags: [console.command]

Expand All @@ -150,8 +145,7 @@ inject the ``command.default_name`` parameter:
</parameters>

<services>
<service id="app.command.my_command"
class="AppBundle\Command\MyCommand">
<service class="AppBundle\Command\MyCommand">
<argument>%command.default_name%</argument>
<tag name="console.command" />
</service>
Expand All @@ -166,7 +160,7 @@ inject the ``command.default_name`` parameter:
$container->setParameter('command.default_name', 'Javier');

$container
->register('app.command.my_command', MyCommand::class)
->register(MyCommand::class)
->setArguments(array('%command.default_name%'))
->addTag('console.command')
;
Expand Down
3 changes: 1 addition & 2 deletions form/type_guesser.rst
Original file line number Diff line number Diff line change
Expand Up @@ -188,8 +188,7 @@ and tag it with ``form.type_guesser``:
services:
# ...

AppBundle\Form\TypeGuesser\PHPDocTypeGuesser:
tags: [form.type_guesser]
AppBundle\Form\TypeGuesser\PHPDocTypeGuesser: [form.type_guesser]

.. code-block:: xml

Expand Down
Loading