Total Complexity | 5 |
Total Lines | 30 |
Duplicated Lines | 0 % |
Changes | 3 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
11 | final class Installer |
||
12 | { |
||
13 | /** |
||
14 | * @psalm-suppress UndefinedClass |
||
15 | */ |
||
16 | public static function postUpdate(): void |
||
17 | { |
||
18 | self::chmodRecursive('runtime', 0777); |
||
19 | self::chmodRecursive('public/assets', 0777); |
||
20 | } |
||
21 | |||
22 | private static function chmodRecursive(string $path, int $mode): void |
||
23 | { |
||
24 | chmod($path, $mode); |
||
25 | |||
26 | /** @psalm-var iterable<array-key, string> $iterator */ |
||
27 | $iterator = new RIterator( |
||
28 | new DirIterator($path, FSIterator::SKIP_DOTS | FSIterator::CURRENT_AS_PATHNAME), |
||
29 | RIterator::SELF_FIRST |
||
30 | ); |
||
31 | |||
32 | foreach ($iterator as $item) { |
||
33 | chmod($item, $mode); |
||
34 | } |
||
35 | } |
||
36 | |||
37 | public static function copyEnvFile(): void |
||
41 | } |
||
42 | } |
||
43 | } |
||
44 |