Conditions | 3 |
Paths | 3 |
Total Lines | 14 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Tests | 8 |
CRAP Score | 3 |
Changes | 0 |
1 | <?php |
||
80 | 2 | protected function getAllFields(array $array, string $path, array $fieldMap): array |
|
81 | { |
||
82 | 2 | foreach ($array as $key => $item) { |
|
83 | 2 | $keypath = (string) substr($path . '.' . $key, 1); |
|
84 | 2 | if (is_array($item)) { |
|
85 | 2 | $fieldMap[$keypath] = $keypath; |
|
86 | 2 | $fieldMap = $this->getAllFields($item, $path . '.' . $key, $fieldMap); |
|
87 | } |
||
88 | else { |
||
89 | 2 | $fieldMap[$keypath] = $keypath; |
|
90 | } |
||
91 | } |
||
92 | |||
93 | 2 | return $fieldMap; |
|
94 | } |
||
95 | } |