Conditions | 3 |
Paths | 3 |
Total Lines | 15 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
43 | public static function keyToArray(string $translationKey, string $value): array |
||
44 | { |
||
45 | $result = []; |
||
46 | $path = ''; |
||
47 | $explodedKey = explode('.', $translationKey); |
||
48 | foreach ($explodedKey as $key) { |
||
49 | if (empty($key)) { |
||
50 | continue; |
||
51 | } |
||
52 | $path .= '[' . $key . ']'; |
||
53 | } |
||
54 | $propertyAccessor = new PropertyAccessor(); |
||
55 | $propertyAccessor->setValue($result, $path, $value); |
||
56 | |||
57 | return $result; |
||
58 | } |
||
60 |