| Conditions | 2 |
| Paths | 2 |
| Total Lines | 18 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 23 | public function run(ApiTypeInterface $type) |
||
| 24 | { |
||
| 25 | // the actual command that needs to be executed |
||
| 26 | $command = "apidoc -c {$type->getJsonFilePath()} -f {$type->getType()}.php -i app -o {$type->getDocumentationPath()}"; |
||
| 27 | |||
| 28 | // execute the command |
||
| 29 | ($process = new Process($command))->run(); |
||
| 30 | |||
| 31 | if (!$process->isSuccessful()) { |
||
| 32 | throw new ProcessFailedException($process); |
||
| 33 | } |
||
| 34 | |||
| 35 | // echo the output |
||
| 36 | echo $type->getType() . ': ' . $process->getOutput(); |
||
| 37 | |||
| 38 | // return the past to that generated documentation |
||
| 39 | return $type->getUrl(); |
||
| 40 | } |
||
| 41 | |||
| 43 |