| @@ 10-38 (lines=29) @@ | ||
| 7 | use Symfony\Component\Console\Input\InputInterface; |
|
| 8 | use Symfony\Component\Console\Output\OutputInterface; |
|
| 9 | ||
| 10 | class ImageVersionsCommand extends BaseCommand |
|
| 11 | { |
|
| 12 | use NewsClientCommandTrait; |
|
| 13 | ||
| 14 | protected function configure() |
|
| 15 | { |
|
| 16 | parent::configure(); |
|
| 17 | ||
| 18 | $this |
|
| 19 | ->setName('news:image:versions'); |
|
| 20 | } |
|
| 21 | ||
| 22 | /** |
|
| 23 | * @param InputInterface $input |
|
| 24 | * @param OutputInterface $output |
|
| 25 | * @return int |
|
| 26 | */ |
|
| 27 | protected function execute(InputInterface $input, OutputInterface $output) |
|
| 28 | { |
|
| 29 | $newsClient = $this->getNewsClient($input); |
|
| 30 | ||
| 31 | $result = $newsClient->getImageVersions(); |
|
| 32 | $formatter = Formatter::make($result, Formatter::ARR); |
|
| 33 | ||
| 34 | $output->writeln($formatter->toYaml()); |
|
| 35 | ||
| 36 | return 0; |
|
| 37 | } |
|
| 38 | } |
|
| 39 | ||
| @@ 10-38 (lines=29) @@ | ||
| 7 | use Symfony\Component\Console\Input\InputInterface; |
|
| 8 | use Symfony\Component\Console\Output\OutputInterface; |
|
| 9 | ||
| 10 | class SectionsListCommand extends BaseCommand |
|
| 11 | { |
|
| 12 | use NewsClientCommandTrait; |
|
| 13 | ||
| 14 | protected function configure() |
|
| 15 | { |
|
| 16 | parent::configure(); |
|
| 17 | ||
| 18 | $this |
|
| 19 | ->setName('news:sections:list'); |
|
| 20 | } |
|
| 21 | ||
| 22 | /** |
|
| 23 | * @param InputInterface $input |
|
| 24 | * @param OutputInterface $output |
|
| 25 | * @return int |
|
| 26 | */ |
|
| 27 | protected function execute(InputInterface $input, OutputInterface $output) |
|
| 28 | { |
|
| 29 | $newsClient = $this->getNewsClient($input); |
|
| 30 | ||
| 31 | $result = $newsClient->getSectionsList(); |
|
| 32 | $formatter = Formatter::make($result, Formatter::ARR); |
|
| 33 | ||
| 34 | $output->writeln($formatter->toYaml()); |
|
| 35 | ||
| 36 | return 0; |
|
| 37 | } |
|
| 38 | } |
|
| 39 | ||
| @@ 10-38 (lines=29) @@ | ||
| 7 | use Symfony\Component\Console\Input\InputInterface; |
|
| 8 | use Symfony\Component\Console\Output\OutputInterface; |
|
| 9 | ||
| 10 | class ServiceDocumentCommand extends BaseCommand |
|
| 11 | { |
|
| 12 | use NewsClientCommandTrait; |
|
| 13 | ||
| 14 | protected function configure() |
|
| 15 | { |
|
| 16 | parent::configure(); |
|
| 17 | ||
| 18 | $this |
|
| 19 | ->setName('news:servicedocument'); |
|
| 20 | } |
|
| 21 | ||
| 22 | /** |
|
| 23 | * @param InputInterface $input |
|
| 24 | * @param OutputInterface $output |
|
| 25 | * @return int |
|
| 26 | */ |
|
| 27 | protected function execute(InputInterface $input, OutputInterface $output) |
|
| 28 | { |
|
| 29 | $newsClient = $this->getNewsClient($input); |
|
| 30 | ||
| 31 | $result = $newsClient->getServiceDocument(); |
|
| 32 | $formatter = Formatter::make($result, Formatter::ARR); |
|
| 33 | ||
| 34 | $output->writeln($formatter->toYaml()); |
|
| 35 | ||
| 36 | return 0; |
|
| 37 | } |
|
| 38 | } |
|
| 39 | ||