Total Complexity | 5 |
Total Lines | 36 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
8 | trait InteractsWithDirectories |
||
9 | { |
||
10 | /** |
||
11 | * Ensure the supplied directory exist by creating it if it does not. |
||
12 | * |
||
13 | * @param string $directory absolute file path to the directory |
||
14 | */ |
||
15 | public static function needsDirectory(string $directory): void |
||
19 | } |
||
20 | } |
||
21 | |||
22 | /** |
||
23 | * Ensure the supplied directories exist by creating them if they don't. |
||
24 | * |
||
25 | * @param array $directories array with absolute file paths to the directories |
||
26 | */ |
||
27 | public static function needsDirectories(array $directories): void |
||
31 | } |
||
32 | } |
||
33 | |||
34 | /** |
||
35 | * Ensure the supplied file's parent directory exists by creating it if it does not. |
||
36 | * |
||
37 | * @param string $file |
||
38 | * @param int $levels |
||
39 | * @return void |
||
40 | */ |
||
41 | public static function needsParentDirectory(string $file, int $levels = 1): void |
||
46 |