Conditions | 7 |
Paths | 4 |
Total Lines | 15 |
Code Lines | 11 |
Lines | 0 |
Ratio | 0 % |
Tests | 11 |
CRAP Score | 7 |
Changes | 0 |
1 | <?php |
||
15 | 3 | public function parse($path = '') { |
|
16 | 3 | $config = []; |
|
17 | 3 | $dir = "$this->path/$path"; |
|
18 | 3 | $files = scandir($dir); |
|
19 | 3 | foreach ($files as $file) { |
|
20 | 3 | if (fnmatch("*.conf.php", $file)) { |
|
21 | 3 | $prefix = substr($file, 0, -9); |
|
22 | 3 | $config[$prefix] = File::read("$dir/$file"); |
|
23 | 3 | } else if (is_dir("{$this->path}/$file") && $file != '.' && $file != '..' && $path === '') { |
|
24 | 3 | $this->contexts[] = $file; |
|
25 | } |
||
26 | } |
||
27 | |||
28 | 3 | return $config; |
|
29 | } |
||
30 | |||
36 |