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