Total Complexity | 5 |
Total Lines | 38 |
Duplicated Lines | 0 % |
Coverage | 0% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
11 | class TranslationListCommand extends Command |
||
12 | { |
||
13 | private $source; |
||
14 | |||
15 | private $config; |
||
16 | |||
17 | public function __construct() |
||
18 | { |
||
19 | parent::__construct(); |
||
20 | $this->config = new Config; |
||
21 | $this->source = new XMLRepository; |
||
22 | $this->source->setConfig($this->config); |
||
23 | } |
||
24 | |||
25 | protected function configure() |
||
26 | { |
||
27 | $this |
||
28 | ->setName('translation:list') |
||
29 | ->setDescription('View available translations'); |
||
30 | } |
||
31 | |||
32 | protected function execute(InputInterface $input, OutputInterface $output): int |
||
33 | { |
||
34 | $translations = $this->translations(); |
||
35 | |||
36 | $output->writeln("<info>Available translations. (For usage, you can use short form, example: </info>en <info>instead of</info> en.sahih <info>)</info>"); |
||
37 | foreach ($translations as $translation) { |
||
38 | $output->writeln(" - <comment>$translation</comment>"); |
||
39 | } |
||
40 | |||
41 | $output->writeln(""); |
||
42 | |||
43 | return 0; |
||
44 | } |
||
45 | |||
46 | private function translations() |
||
49 | } |
||
50 | } |
||
51 |