diff --git a/cookbook/console/commands_as_services.rst b/cookbook/console/commands_as_services.rst index a60ebaa11e7..6b39cefe78b 100644 --- a/cookbook/console/commands_as_services.rst +++ b/cookbook/console/commands_as_services.rst @@ -42,11 +42,13 @@ with ``console.command``: + xsi:schemaLocation="http://symfony.com/schema/dic/services + http://symfony.com/schema/dic/services/services-1.0.xsd"> + @@ -56,7 +58,10 @@ with ``console.command``: // app/config/config.php $container - ->register('acme_hello.command.my_command', 'Acme\HelloBundle\Command\MyCommand') + ->register( + 'acme_hello.command.my_command', + 'Acme\HelloBundle\Command\MyCommand' + ) ->addTag('console.command') ; @@ -67,7 +72,7 @@ Imagine you want to provide a default value for the ``name`` option. You could pass one of the following as the 5th argument of ``addOption()``: * a hardcoded string; -* a container parameter (e.g. something from parameters.yml); +* a container parameter (e.g. something from ``parameters.yml``); * a value computed by a service (e.g. a repository). By extending ``ContainerAwareCommand``, only the first is possible, because you @@ -102,7 +107,13 @@ have some ``NameRepository`` service that you'll use to get your default value:: $this ->setName('demo:greet') ->setDescription('Greet someone') - ->addOption('name', '-n', InputOption::VALUE_REQUIRED, 'Who do you want to greet?', $defaultName) + ->addOption( + 'name', + '-n', + InputOption::VALUE_REQUIRED, + 'Who do you want to greet?', + $defaultName + ) ; }