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