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