Conditions | 3 |
Paths | 4 |
Total Lines | 15 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
21 | public function execute(string $command) |
||
22 | { |
||
23 | $command .= ' 2>&1'; |
||
24 | |||
25 | exec($command, $output, $code); |
||
26 | |||
27 | $output = $this->lastCommand = count($output) === 0 |
||
28 | ? $code |
||
29 | : implode(PHP_EOL, $output); |
||
30 | |||
31 | if ($code !== 0) { |
||
32 | throw new CommandException($command, $output, $code); |
||
33 | } |
||
34 | |||
35 | return $output; |
||
36 | } |
||
46 |