| Conditions | 3 |
| Paths | 3 |
| Total Lines | 14 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 7 |
| CRAP Score | 3.0175 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 29 | 15 | public function load(string $lang): array |
|
| 30 | { |
||
| 31 | 15 | if ($lang !== $this->lang) { |
|
| 32 | 15 | return []; |
|
| 33 | } |
||
| 34 | |||
| 35 | 15 | $content = @file_get_contents($this->filepath); |
|
| 36 | 15 | if ($content === false) { |
|
| 37 | // @TODO: exception? |
||
| 38 | return []; |
||
| 39 | } |
||
| 40 | |||
| 41 | 15 | $records = Neon::decode($content); |
|
| 42 | 15 | return [new Dictionary($lang, Arr::flatten($records, $this->prefix))]; |
|
| 43 | } |
||
| 45 |