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