| Conditions | 4 |
| Paths | 3 |
| Total Lines | 15 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 20 |
| Changes | 0 | ||
| 1 | <?php |
||
| 22 | protected function execute(InputInterface $input, OutputInterface $output) |
||
| 23 | { |
||
| 24 | if (!is_file($input->getOption('config'))) { |
||
| 25 | throw new InvalidArgumentException('File "' . $input->getOption('config') . '" does not exist'); |
||
| 26 | } |
||
| 27 | parse_str($input->getOption('params'), $params); |
||
| 28 | extract($params); |
||
| 29 | |||
| 30 | $translationFinder = require_once $input->getOption('config'); |
||
| 31 | if (!$translationFinder instanceof TranslationFinder) { |
||
| 32 | throw new InvalidConfigInstanceReturnedException('"' . (is_object($translationFinder) ? get_class($translationFinder) : $translationFinder) . '" is not instance of ' . TranslationFinder::class); |
||
| 33 | } |
||
| 34 | |||
| 35 | $result = $translationFinder->translate(); |
||
| 36 | $output->writeln('<comment>' . $result . ' tokens replaced</comment>'); |
||
| 37 | } |
||
| 39 |