Conditions | 4 |
Paths | 4 |
Total Lines | 14 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 20 |
Changes | 1 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
6 | public function load() { |
||
7 | $content = file_get_contents($this->file); |
||
8 | $lines = explode("\n", $content); |
||
9 | $result = []; |
||
10 | foreach ($lines as $line) { |
||
11 | $line = trim($line); |
||
12 | if (substr($line, 0, strlen('#')) !== '#') { |
||
13 | $kv = explode(':', $line); |
||
14 | if (sizeof($kv) == 2) { |
||
15 | $result[trim($kv[0])] = trim($kv[1]); |
||
16 | } |
||
17 | } |
||
18 | } |
||
19 | return $result; |
||
20 | } |
||
23 |