| Conditions | 2 |
| Paths | 2 |
| Total Lines | 14 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 9 |
| CRAP Score | 2 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 18 | 2 | public function __invoke(Task $task): Result |
|
| 19 | { |
||
| 20 | 2 | $process = clone $task->getProcess(); |
|
|
|
|||
| 21 | |||
| 22 | 2 | $process->run(); |
|
| 23 | |||
| 24 | 2 | if ($process->isSuccessful()) { |
|
| 25 | 1 | return Result::successful($task, $process->getOutput()); |
|
| 26 | } |
||
| 27 | |||
| 28 | 1 | return Result::failure( |
|
| 29 | 1 | $task, |
|
| 30 | 1 | "Exit {$process->getExitCode()}: {$process->getExitCodeText()}", |
|
| 31 | 1 | $process->getOutput().$process->getErrorOutput() |
|
| 32 | ); |
||
| 40 |