Conditions | 4 |
Paths | 1 |
Total Lines | 15 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 20 |
Changes | 1 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
19 | public function read(Collection $files, Collection $locales) |
||
20 | { |
||
21 | return $locales->reduce(function ($translations, $locale) use ($files) { |
||
22 | $files->each(function ($file) use ($locale, &$translations) { |
||
23 | if (file_exists($path = $this->pathToFile($file, $locale))) { |
||
24 | $content[$file] = include_once $path; |
||
|
|||
25 | |||
26 | foreach (Arr::dot($content) as $key => $value) { |
||
27 | $translations[$key][$locale->iso6391()] = $value ? $value : ''; |
||
28 | } |
||
29 | } |
||
30 | }); |
||
31 | |||
32 | return $translations; |
||
33 | }, []); |
||
34 | } |
||
49 |