| Conditions | 3 |
| Paths | 3 |
| Total Lines | 14 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 10 |
| CRAP Score | 3 |
| Changes | 0 | ||
| 1 | <?php |
||
| 17 | 16 | public function load($lang) |
|
| 18 | { |
||
| 19 | 16 | $translations = []; |
|
| 20 | 16 | $dir = $this->localizationDirectory . '/' . $lang; |
|
| 21 | 16 | if (!file_exists($dir)) { |
|
| 22 | 8 | return $translations; |
|
| 23 | } |
||
| 24 | 14 | $files = Finder::findFiles('*.neon')->in($dir); |
|
| 25 | 14 | foreach ($files as $file) { |
|
| 26 | 14 | $translations[pathinfo($file, PATHINFO_FILENAME)] = Neon::decode(file_get_contents($file)); |
|
| 27 | } |
||
| 28 | 14 | $this->flatten($translations); |
|
| 29 | 14 | return $translations; |
|
| 30 | } |
||
| 31 | |||
| 50 |