Skip to content

Commit 0b7f89b

Browse files
committed
minor #4868 Remove horizontal scrollbar (ifdattic)
This PR was submitted for the 2.4 branch but it was merged into the 2.6 branch instead (closes #4868). Discussion ---------- Remove horizontal scrollbar | Q | A | ------------- | --- | Doc fix? | yes | New docs? | no | Applies to | 2.3 | Fixed tickets | Commits ------- bed19da Remove horizontal scrollbar
2 parents c166fdf + bed19da commit 0b7f89b

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed

cookbook/console/commands_as_services.rst

+15-4
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,13 @@ with ``console.command``:
3838
<?xml version="1.0" encoding="UTF-8" ?>
3939
<container xmlns="http://symfony.com/schema/dic/services"
4040
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
41-
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">
41+
xsi:schemaLocation="http://symfony.com/schema/dic/services
42+
http://symfony.com/schema/dic/services/services-1.0.xsd">
4243
4344
<services>
4445
<service id="acme_hello.command.my_command"
4546
class="Acme\HelloBundle\Command\MyCommand">
47+
4648
<tag name="console.command" />
4749
</service>
4850
</services>
@@ -52,7 +54,10 @@ with ``console.command``:
5254
5355
// app/config/config.php
5456
$container
55-
->register('acme_hello.command.my_command', 'Acme\HelloBundle\Command\MyCommand')
57+
->register(
58+
'acme_hello.command.my_command',
59+
'Acme\HelloBundle\Command\MyCommand'
60+
)
5661
->addTag('console.command')
5762
;
5863
@@ -63,7 +68,7 @@ Imagine you want to provide a default value for the ``name`` option. You could
6368
pass one of the following as the 5th argument of ``addOption()``:
6469

6570
* a hardcoded string;
66-
* a container parameter (e.g. something from parameters.yml);
71+
* a container parameter (e.g. something from ``parameters.yml``);
6772
* a value computed by a service (e.g. a repository).
6873

6974
By extending ``ContainerAwareCommand``, only the first is possible, because you
@@ -98,7 +103,13 @@ have some ``NameRepository`` service that you'll use to get your default value::
98103
$this
99104
->setName('demo:greet')
100105
->setDescription('Greet someone')
101-
->addOption('name', '-n', InputOption::VALUE_REQUIRED, 'Who do you want to greet?', $defaultName)
106+
->addOption(
107+
'name',
108+
'-n',
109+
InputOption::VALUE_REQUIRED,
110+
'Who do you want to greet?',
111+
$defaultName
112+
)
102113
;
103114
}
104115

0 commit comments

Comments
 (0)