| Conditions | 2 |
| Paths | 2 |
| Total Lines | 18 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 39 | public function run(ApiTypeInterface $type) |
||
| 40 | { |
||
| 41 | // the actual command that needs to be executed |
||
| 42 | $command = "{$this->config->get('apidoc.executable')} -c {$type->getJsonFilePath()} -f {$type->getType()}.php -i app -o {$type->getDocumentationPath()}"; |
||
| 43 | |||
| 44 | // execute the command |
||
| 45 | ($process = new Process($command))->run(); |
||
| 46 | |||
| 47 | if (!$process->isSuccessful()) { |
||
| 48 | throw new ProcessFailedException($process); |
||
| 49 | } |
||
| 50 | |||
| 51 | // echo the output |
||
| 52 | echo $type->getType() . ': ' . $process->getOutput(); |
||
| 53 | |||
| 54 | // return the past to that generated documentation |
||
| 55 | return $type->getUrl(); |
||
| 56 | } |
||
| 57 | |||
| 59 |