| Conditions | 5 |
| Paths | 4 |
| Total Lines | 21 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 14 | public function parse() |
||
| 15 | { |
||
| 16 | try { |
||
| 17 | $this->ensureFileIsReadable(); |
||
| 18 | } catch (InvalidPathException $e) { |
||
| 19 | return []; |
||
| 20 | } |
||
| 21 | |||
| 22 | $filePath = $this->filePath; |
||
| 23 | $lines = $this->readLinesFromFile($filePath); |
||
| 24 | |||
| 25 | $data = []; |
||
| 26 | foreach ($lines as $line) { |
||
| 27 | if (!$this->isComment($line) && $this->looksLikeSetter($line)) { |
||
| 28 | list($name, $value) = $this->processFilters($line, null); |
||
| 29 | $data[$name] = $value; |
||
| 30 | } |
||
| 31 | } |
||
| 32 | |||
| 33 | return $data; |
||
| 34 | } |
||
| 35 | } |
||
| 36 |