| Conditions | 3 |
| Paths | 14 |
| Total Lines | 23 |
| Code Lines | 15 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 2 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 25 | protected function execute(InputInterface $input, OutputInterface $output) |
||
| 26 | { |
||
| 27 | $rootDir = $input->getArgument("path"); |
||
| 28 | if (empty($rootDir)) { |
||
| 29 | $rootDir = getcwd(); |
||
| 30 | } |
||
| 31 | try { |
||
| 32 | $generator = $this->get(IndexGenerator::class); |
||
| 33 | |||
| 34 | $project = new Project( |
||
| 35 | $this->get(Index::class), |
||
| 36 | $rootDir |
||
| 37 | ); |
||
| 38 | |||
| 39 | $generator->generateIndex($project); |
||
| 40 | $persister = $this->get(Persister::class); |
||
| 41 | |||
| 42 | $persister->save($project); |
||
| 43 | $output->writeln("<info>Index generated</info>"); |
||
| 44 | } catch (\Exception $e) { |
||
| 45 | $output->writeln(sprintf("<error>Error: %s</error>", $e->getMessage())); |
||
| 46 | } |
||
| 47 | } |
||
| 48 | } |
||
| 49 |