Total Complexity | 6 |
Total Lines | 33 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
10 | final class ComposerUpdateHook implements BeforeFirstTestHook |
||
11 | { |
||
12 | public function executeBeforeFirstTest(): void |
||
13 | { |
||
14 | $command = sprintf( |
||
15 | '%s && %s', |
||
16 | $this->cwdToEnvironment(), |
||
17 | '[ -d vendor ] && composer dump || composer upd -n --prefer-dist --no-progress --no-suggest --ignore-platform-reqs ' . $this->suppressLogs(), |
||
18 | ); |
||
19 | $this->exec($command); |
||
20 | } |
||
21 | |||
22 | private function cwdToEnvironment(): string |
||
23 | { |
||
24 | return sprintf( |
||
25 | 'cd %s', |
||
26 | PathHelper::realpath(__DIR__) . '/Environment', |
||
27 | ); |
||
28 | } |
||
29 | |||
30 | private function suppressLogs(): string |
||
36 | } |
||
37 | |||
38 | private function exec(string $command): void |
||
43 | } |
||
44 | } |
||
45 | } |
||
46 |