@@ -33,8 +33,17 @@ want to extend the AppBundle to greet you from the command line, create
33
33
$this
34
34
->setName('demo:greet')
35
35
->setDescription('Greet someone')
36
- ->addArgument('name', InputArgument::OPTIONAL, 'Who do you want to greet?')
37
- ->addOption('yell', null, InputOption::VALUE_NONE, 'If set, the task will yell in uppercase letters')
36
+ ->addArgument(
37
+ 'name',
38
+ InputArgument::OPTIONAL,
39
+ 'Who do you want to greet?'
40
+ )
41
+ ->addOption(
42
+ 'yell',
43
+ null,
44
+ InputOption::VALUE_NONE,
45
+ 'If set, the task will yell in uppercase letters'
46
+ )
38
47
;
39
48
}
40
49
@@ -94,7 +103,9 @@ translate some contents using a console command::
94
103
$name = $input->getArgument('name');
95
104
$translator = $this->getContainer()->get('translator');
96
105
if ($name) {
97
- $output->writeln($translator->trans('Hello %name%!', array('%name%' => $name)));
106
+ $output->writeln(
107
+ $translator->trans('Hello %name%!', array('%name%' => $name))
108
+ );
98
109
} else {
99
110
$output->writeln($translator->trans('Hello!'));
100
111
}
@@ -128,7 +139,9 @@ before translating contents::
128
139
$translator->setLocale($locale);
129
140
130
141
if ($name) {
131
- $output->writeln($translator->trans('Hello %name%!', array('%name%' => $name)));
142
+ $output->writeln(
143
+ $translator->trans('Hello %name%!', array('%name%' => $name))
144
+ );
132
145
} else {
133
146
$output->writeln($translator->trans('Hello!'));
134
147
}
0 commit comments