| Conditions | 3 |
| Paths | 3 |
| Total Lines | 18 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 4 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 25 | protected function execute(InputInterface $input, OutputInterface $output): int |
||
| 26 | { |
||
| 27 | $sites = $this->getSites(); |
||
| 28 | |||
| 29 | if (true === $input->getOption('json')) { |
||
| 30 | $output->write(json_encode($sites)); |
||
| 31 | |||
| 32 | return 0; |
||
| 33 | } |
||
| 34 | |||
| 35 | $table = new Table($output); |
||
| 36 | $table->setHeaders(['Site ID', 'Status', 'Domain']); |
||
| 37 | foreach ($sites as $site) { |
||
| 38 | $table->addRow([$site['site_id'], $site['status'], $site['domain']]); |
||
| 39 | } |
||
| 40 | $table->render(); |
||
| 41 | |||
| 42 | return 0; |
||
| 43 | } |
||
| 63 |