Total Complexity | 7 |
Total Lines | 34 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
5 | class Loader |
||
6 | { |
||
7 | /** |
||
8 | * Include all PHP files from a directory. |
||
9 | * |
||
10 | * @param $dirPath |
||
11 | */ |
||
12 | public static function includeAllFilesFromDir($dirPath): void |
||
13 | { |
||
14 | $includedFiles = get_included_files(); |
||
15 | 3 | ||
16 | foreach (glob($dirPath . '/*.php') as $filename) { |
||
17 | 3 | if (!in_array($filename, $includedFiles, true)) { |
|
18 | include_once $filename; |
||
19 | 3 | } |
|
20 | 3 | } |
|
21 | 3 | } |
|
22 | |||
23 | /** |
||
24 | 3 | * Include all PHP files from a directory, recursively. |
|
25 | * |
||
26 | * @param $dirPath |
||
27 | */ |
||
28 | public static function includeAllFilesFromDirRecursive($dirPath): void |
||
39 | 3 | } |
|
40 | 3 | } |
|
44 |