| Conditions | 6 |
| Paths | 16 |
| Total Lines | 18 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 42 |
| Changes | 0 | ||
| 1 | <?php |
||
| 40 | public function read($path) |
||
| 41 | { |
||
| 42 | $skippable = 0 === strncmp($path, '?', 1) ? '?' : ''; |
||
| 43 | if ($skippable) { |
||
| 44 | $path = substr($path, 1); |
||
| 45 | } |
||
| 46 | |||
| 47 | if (is_readable($path)) { |
||
| 48 | $res = $this->readRaw($path); |
||
| 49 | |||
| 50 | return is_array($res) ? $res : []; |
||
| 51 | } |
||
| 52 | |||
| 53 | if (empty($skippable)) { |
||
| 54 | throw new FailedReadException("failed read file: $path"); |
||
| 55 | } |
||
| 56 | |||
| 57 | return []; |
||
| 58 | } |
||
| 72 |