@@ -18,14 +18,14 @@ discard block |
||
| 18 | 18 | { |
| 19 | 19 | $this->setName('extract') |
| 20 | 20 | ->setDescription('Finds non-translated texts, replaces them with translate tokens and store these texts to storage') |
| 21 | - ->addArgument('config', InputArgument::REQUIRED, 'Path to config file. Instance of ' . ExtractorConfig::class . ' have to be returned') |
|
| 21 | + ->addArgument('config', InputArgument::REQUIRED, 'Path to config file. Instance of '.ExtractorConfig::class.' have to be returned') |
|
| 22 | 22 | ->addOption('params', null, InputOption::VALUE_REQUIRED, 'Params for config in format --params="a=b&c=d"'); |
| 23 | 23 | } |
| 24 | 24 | |
| 25 | 25 | protected function execute(InputInterface $input, OutputInterface $output) |
| 26 | 26 | { |
| 27 | 27 | if (!is_file($input->getArgument('config'))) { |
| 28 | - throw new InvalidArgumentException('File "' . $input->getArgument('config') . '" does not exist'); |
|
| 28 | + throw new InvalidArgumentException('File "'.$input->getArgument('config').'" does not exist'); |
|
| 29 | 29 | } |
| 30 | 30 | parse_str($input->getOption('params'), $params); |
| 31 | 31 | extract($params); |
@@ -35,7 +35,7 @@ discard block |
||
| 35 | 35 | throw $extractorConfig; |
| 36 | 36 | } |
| 37 | 37 | if (!$extractorConfig instanceof ExtractorConfig) { |
| 38 | - throw new InvalidConfigInstanceReturnedException('"' . (is_object($extractorConfig) ? get_class($extractorConfig) : $extractorConfig) . '" is not instance of ' . ExtractorConfig::class); |
|
| 38 | + throw new InvalidConfigInstanceReturnedException('"'.(is_object($extractorConfig) ? get_class($extractorConfig) : $extractorConfig).'" is not instance of '.ExtractorConfig::class); |
|
| 39 | 39 | } |
| 40 | 40 | |
| 41 | 41 | $output->writeln(''); |
@@ -45,19 +45,19 @@ discard block |
||
| 45 | 45 | foreach ($tokenCollections as $tokenCollection) { |
| 46 | 46 | $totalTokens += count($tokenCollection->getTokens()); |
| 47 | 47 | } |
| 48 | - $output->writeln($totalTokens . ' tokens found'); |
|
| 48 | + $output->writeln($totalTokens.' tokens found'); |
|
| 49 | 49 | $output->writeln('Processing tokens...'); |
| 50 | 50 | $output->writeln(''); |
| 51 | 51 | |
| 52 | 52 | $progressBar = new ProgressBar($output, $totalTokens); |
| 53 | 53 | $tokensReplaced = 0; |
| 54 | 54 | foreach ($tokenCollections as $tokenCollection) { |
| 55 | - $extractorConfig->process($tokenCollection, function (Token $token) use ($progressBar, &$tokensReplaced) { |
|
| 55 | + $extractorConfig->process($tokenCollection, function(Token $token) use ($progressBar, &$tokensReplaced) { |
|
| 56 | 56 | $progressBar->advance(); |
| 57 | 57 | $tokensReplaced++; |
| 58 | 58 | }); |
| 59 | 59 | } |
| 60 | 60 | $output->writeln("\n\n"); |
| 61 | - $output->writeln('<comment>' . $tokensReplaced . ' tokens replaced</comment>'); |
|
| 61 | + $output->writeln('<comment>'.$tokensReplaced.' tokens replaced</comment>'); |
|
| 62 | 62 | } |
| 63 | 63 | } |