Total Complexity | 6 |
Total Lines | 45 |
Duplicated Lines | 0 % |
Changes | 3 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
12 | class SitesListAttributeCommand extends AbstractCommand |
||
13 | { |
||
14 | protected function configure(): void |
||
22 | ; |
||
23 | } |
||
24 | |||
25 | protected function execute(InputInterface $input, OutputInterface $output): int |
||
26 | { |
||
27 | $attribute = $input->getOption('attribute'); |
||
28 | |||
29 | $sites = $this->getSites(); |
||
30 | |||
31 | $table = new Table($output); |
||
32 | $table->setHeaders(['Site ID', 'Domain', 'Attribute']); |
||
33 | foreach ($sites as $site) { |
||
34 | $table->addRow([$site['site_id'], $site['domain'], $site[$attribute]]); |
||
35 | } |
||
36 | $table->render(); |
||
37 | |||
38 | return 0; |
||
39 | } |
||
40 | |||
41 | protected function getSites(): array |
||
57 | } |
||
58 | } |
||
59 |