| Conditions | 3 |
| Paths | 3 |
| Total Lines | 13 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 7 |
| CRAP Score | 3 |
| Changes | 0 | ||
| 1 | <?php |
||
| 44 | 2 | public function run(Command $command, OutputFormatter $formatter = null) : Result |
|
| 45 | { |
||
| 46 | 2 | $cmd = $this->process->run($command->getCommand()); |
|
| 47 | |||
| 48 | 2 | if (!$cmd->wasSuccessful()) { |
|
| 49 | 1 | throw new RuntimeException('Command failed and exited with return code \'' . $cmd->getCode() . '\''); |
|
| 50 | } |
||
| 51 | |||
| 52 | 1 | $formatted = $formatter !== null ? $formatter->format($cmd->getStdOutAsArray()) : []; |
|
| 53 | 1 | $result = new Result($cmd, $formatted); |
|
| 54 | |||
| 55 | 1 | return $result; |
|
| 56 | } |
||
| 57 | } |
||
| 58 |