| Conditions | 2 |
| Paths | 2 |
| Total Lines | 23 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 41 | public function run($type, $console) |
||
| 42 | { |
||
| 43 | $path = $this->getDocumentationPath($type); |
||
| 44 | |||
| 45 | $exe = $this->getExecutable(); |
||
| 46 | |||
| 47 | // the actual command that needs to be executed: |
||
| 48 | $command = $exe . ' ' . "-c {$this->getJsonFilePath($type)} {$this->getEndpointFiles($type)}-i app -o {$path}"; |
||
| 49 | |||
| 50 | // execute the command |
||
| 51 | ($process = new Process($command))->run(); |
||
| 52 | |||
| 53 | if (!$process->isSuccessful()) { |
||
| 54 | throw new ProcessFailedException($process); |
||
| 55 | } |
||
| 56 | |||
| 57 | // echo the output |
||
| 58 | $console->info('[' . $type . '] ' . $command); |
||
| 59 | $console->info('Result: ' . $process->getOutput()); |
||
| 60 | |||
| 61 | // return the past to that generated documentation |
||
| 62 | return $this->getFullApiUrl($type); |
||
| 63 | } |
||
| 64 | |||
| 66 |