| Conditions | 7 |
| Paths | 14 |
| Total Lines | 17 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 12 |
| CRAP Score | 7 |
| Changes | 0 | ||
| 1 | <?php |
||
| 32 | 14 | private function flatten(array &$messages, array $subnode = null, $path = null) |
|
| 33 | { |
||
| 34 | 14 | if ($subnode === null) { |
|
| 35 | 14 | $subnode = &$messages; |
|
| 36 | } |
||
| 37 | 14 | foreach ($subnode as $key => $value) { |
|
| 38 | 14 | if (is_array($value)) { |
|
| 39 | 14 | $nodePath = $path ? $path . '.' . $key : $key; |
|
| 40 | 14 | $this->flatten($messages, $value, $nodePath); |
|
| 41 | 14 | if ($path === null) { |
|
| 42 | 14 | unset($messages[$key]); |
|
| 43 | } |
||
| 44 | 14 | } elseif ($path !== null) { |
|
| 45 | 14 | $messages[$path . '.' . $key] = $value; |
|
| 46 | } |
||
| 47 | } |
||
| 48 | 14 | } |
|
| 49 | } |
||
| 50 |