Conditions | 4 |
Paths | 3 |
Total Lines | 20 |
Code Lines | 14 |
Lines | 0 |
Ratio | 0 % |
Changes | 3 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
33 | protected function execute(InputInterface $input, OutputInterface $output) |
||
34 | { |
||
35 | $jsonDb = $this->databaseService->getProjects(); |
||
36 | if (is_null($jsonDb) || count($jsonDb) == 0) { |
||
37 | $output->writeln(''); |
||
38 | $output->writeln('<info>'.ShowProjectsCommandText::OK_0_PROJECTS.'</info>'); |
||
39 | } else { |
||
40 | $tableData = []; |
||
41 | foreach ($jsonDb as $k =>$v) { |
||
42 | $tableData[] = [$k,$v]; |
||
43 | } |
||
44 | |||
45 | $table = new Table($output); |
||
46 | $table |
||
47 | ->setHeaders(array('Name', 'Path')) |
||
48 | ->setRows($tableData) |
||
49 | ; |
||
50 | $table->render(); |
||
51 | } |
||
52 | } |
||
53 | } |