Conditions | 4 |
Paths | 6 |
Total Lines | 15 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
19 | public static function fieldsTransformer(array $fields, callable $transformer, array $shortLanguageList = []): array |
||
20 | { |
||
21 | $output = []; |
||
22 | |||
23 | if (empty($shortLanguageList)) { |
||
24 | $shortLanguageList = Language::shortLanguageList(); |
||
25 | } |
||
26 | |||
27 | foreach ($fields as $fieldKey => $fieldValue) { |
||
28 | foreach ($shortLanguageList as $shortLang) { |
||
29 | $output[$fieldKey.'_'.$shortLang] = call_user_func($transformer, $fieldValue, $shortLang); |
||
30 | } |
||
31 | } |
||
32 | |||
33 | return $output; |
||
34 | } |
||
49 | } |