Conditions | 5 |
Paths | 8 |
Total Lines | 27 |
Code Lines | 12 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 30 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
16 | public function make( |
||
17 | AllTranslationInterface $allTranslationInterface, |
||
18 | ExportTranslationInterface $exportTranslationInterface, |
||
19 | $locales |
||
20 | ): string |
||
21 | { |
||
22 | $translations = $allTranslationInterface->get($locales); |
||
23 | |||
24 | $parsedTranslations = []; |
||
25 | |||
26 | foreach ($translations as $values) { |
||
27 | foreach ($values as $key => $value) { |
||
28 | if (array_key_exists($key, array_flip($locales))) { |
||
29 | $parsedTranslations[$key][] = [ |
||
30 | 'group' => $values['group'], |
||
31 | 'key' => $values['group'] . '.' . $values['key'], |
||
32 | 'value' => $value |
||
33 | ]; |
||
34 | } |
||
35 | } |
||
36 | } |
||
37 | |||
38 | foreach ($parsedTranslations as &$translation) { |
||
39 | $translation = collect($translation); |
||
40 | } |
||
41 | |||
42 | return $exportTranslationInterface->export($parsedTranslations); |
||
43 | } |
||
45 |