| Conditions | 3 |
| Paths | 6 |
| Total Lines | 17 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 3 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 16 | public function read(string $filename): array |
||
| 17 | { |
||
| 18 | ob_start(); |
||
| 19 | |||
| 20 | try { |
||
| 21 | $data = (require $filename); |
||
| 22 | } catch (Throwable $exc) { |
||
| 23 | throw new InvalidConfigFileException($filename, 0, $exc); |
||
| 24 | } finally { |
||
| 25 | ob_end_clean(); |
||
| 26 | } |
||
| 27 | |||
| 28 | if (!is_array($data)) { |
||
| 29 | throw new InvalidConfigFileException($filename); |
||
| 30 | } |
||
| 31 | |||
| 32 | return $data; |
||
| 33 | } |
||
| 35 |