|
37 | 37 | */
|
38 | 38 | class ExtractTranslationCommand extends Command
|
39 | 39 | {
|
40 |
| - /** |
41 |
| - * @var ConfigFactory |
42 |
| - */ |
43 |
| - private $configFactory; |
| 40 | + private ConfigFactory $configFactory; |
44 | 41 |
|
45 |
| - /** |
46 |
| - * @var Updater |
47 |
| - */ |
48 |
| - private $updater; |
| 42 | + private Updater $updater; |
49 | 43 |
|
50 |
| - /** |
51 |
| - * @var array |
52 |
| - */ |
53 |
| - private $locales; |
| 44 | + private array $locales; |
54 | 45 |
|
55 | 46 | public function __construct(ConfigFactory $configFactory, Updater $updater, array $locales)
|
56 | 47 | {
|
@@ -82,7 +73,8 @@ protected function configure(): void
|
82 | 73 | ->addOption('intl-icu', null, InputOption::VALUE_NONE, 'Flag to indicate if translations should be dumped to using the ICU message format.')
|
83 | 74 | ->addOption('default-output-format', null, InputOption::VALUE_REQUIRED, 'The default output format (defaults to xlf).')
|
84 | 75 | ->addOption('keep', null, InputOption::VALUE_NONE, 'Define if the updater service should keep the old translation (defaults to false).')
|
85 |
| - ->addOption('external-translations-dir', null, InputOption::VALUE_IS_ARRAY | InputOption::VALUE_REQUIRED, 'Load external translation resources'); |
| 76 | + ->addOption('external-translations-dir', null, InputOption::VALUE_IS_ARRAY | InputOption::VALUE_REQUIRED, 'Load external translation resources') |
| 77 | + ; |
86 | 78 | }
|
87 | 79 |
|
88 | 80 | protected function execute(InputInterface $input, OutputInterface $output): int
|
@@ -142,18 +134,18 @@ protected function execute(InputInterface $input, OutputInterface $output): int
|
142 | 134 | }
|
143 | 135 | }
|
144 | 136 |
|
145 |
| - return 0; |
| 137 | + return Command::SUCCESS; |
146 | 138 | }
|
147 | 139 |
|
148 | 140 | $this->updater->process($config);
|
149 | 141 | }
|
150 | 142 |
|
151 | 143 | $output->writeln('done!');
|
152 | 144 |
|
153 |
| - return 0; |
| 145 | + return Command::SUCCESS; |
154 | 146 | }
|
155 | 147 |
|
156 |
| - private function updateWithInput(InputInterface $input, ConfigBuilder $builder) |
| 148 | + private function updateWithInput(InputInterface $input, ConfigBuilder $builder): void |
157 | 149 | {
|
158 | 150 | if ($bundle = $input->getOption('bundle')) {
|
159 | 151 | if ('@' === $bundle[0]) {
|
|
0 commit comments