Conditions | 3 |
Paths | 4 |
Total Lines | 16 |
Code Lines | 11 |
Lines | 0 |
Ratio | 0 % |
Changes | 2 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
11 | public function executeBeforeFirstTest(): void |
||
12 | { |
||
13 | $commandArguments = $_SERVER['argv'] ?? []; |
||
14 | $isDebug = in_array('--debug', $commandArguments, true); |
||
15 | $hideLogs = !$isDebug ? '2>/dev/null' : ''; |
||
16 | $command = sprintf( |
||
17 | 'cd %s && %s && %s', |
||
18 | __DIR__ . '/Environment', |
||
19 | 'rm vendor -rf ' . $hideLogs, |
||
20 | 'composer upd -n --prefer-dist --no-progress --no-suggest --ignore-platform-reqs ' . $hideLogs |
||
21 | ); |
||
22 | |||
23 | $res = exec($command, $_, $returnCode); |
||
24 | |||
25 | if ((int) $returnCode !== 0) { |
||
26 | throw new \RuntimeException($res); |
||
27 | } |
||
30 |