Conditions | 5 |
Paths | 8 |
Total Lines | 18 |
Code Lines | 12 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 30 |
Changes | 0 |
1 | <?php |
||
20 | public function parsePath($path, $minimal = null) |
||
21 | { |
||
22 | $items = []; |
||
23 | $lines = is_file($path) ? $this->readArray($path) : []; |
||
24 | $comment = ''; |
||
25 | foreach ($lines as $str) { |
||
26 | $str = trim($str); |
||
27 | if (!$str) { |
||
28 | continue; |
||
29 | } |
||
30 | if ($str[0] === '#') { |
||
31 | $comment = trim(substr($str, 1)); |
||
32 | } else { |
||
33 | $items[$str] = $comment; |
||
34 | } |
||
35 | } |
||
36 | |||
37 | return $items; |
||
38 | } |
||
61 |