Conditions | 5 |
Paths | 8 |
Total Lines | 18 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
20 | public function read($path): array |
||
21 | { |
||
22 | $skippable = 0 === strncmp($path, '?', 1); |
||
23 | if ($skippable) { |
||
24 | $path = substr($path, 1); |
||
25 | } |
||
26 | |||
27 | if (is_readable($path)) { |
||
28 | $res = $this->readRaw($path); |
||
29 | |||
30 | return is_array($res) ? $res : []; |
||
31 | } |
||
32 | |||
33 | if (!$skippable) { |
||
34 | throw new FailedReadException("failed read file: $path"); |
||
35 | } |
||
36 | |||
37 | return []; |
||
38 | } |
||
52 |