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