| Conditions | 4 |
| Paths | 4 |
| Total Lines | 18 |
| Code Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 14 |
| CRAP Score | 4 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 43 | 3 | protected function expandDottedKey($data) |
|
| 44 | { |
||
| 45 | 3 | foreach ($data as $key => $value) { |
|
| 46 | 3 | if (($found = strpos($key, '.')) !== false) { |
|
| 47 | 3 | $newKey = substr($key, 0, $found); |
|
| 48 | 3 | $remainder = substr($key, $found + 1); |
|
| 49 | |||
| 50 | 3 | $expandedValue = $this->expandDottedKey([$remainder => $value]); |
|
| 51 | 3 | if (isset($data[$newKey])) { |
|
| 52 | 3 | $data[$newKey] = array_merge_recursive($data[$newKey], $expandedValue); |
|
| 53 | 2 | } else { |
|
| 54 | 3 | $data[$newKey] = $expandedValue; |
|
| 55 | } |
||
| 56 | 3 | unset($data[$key]); |
|
| 57 | 2 | } |
|
| 58 | 2 | } |
|
| 59 | 3 | return $data; |
|
| 60 | } |
||
| 61 | |||
| 70 |