Conditions | 2 |
Paths | 2 |
Total Lines | 15 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Tests | 8 |
CRAP Score | 2.0054 |
Changes | 1 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
16 | 1 | public function execute($command, OutputInterface $output = null) |
|
17 | { |
||
18 | 1 | $process = new Process($command); |
|
19 | 1 | $process->setTimeout(120); |
|
20 | |||
21 | 1 | $process->run(function ($type, $buffer) use ($output) { |
|
22 | 1 | $output->writeln($buffer); |
|
23 | 1 | }); |
|
24 | |||
25 | 1 | if (!$process->isSuccessful()) { |
|
26 | throw new \RuntimeException($process->getErrorOutput()); |
||
27 | } |
||
28 | |||
29 | 1 | return $process->getExitCode(); |
|
30 | } |
||
31 | |||
40 |