| Conditions | 6 |
| Paths | 4 |
| Total Lines | 16 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 9 | public function mergeContexts(array $context1, array $context2): array |
||
| 10 | { |
||
| 11 | $finalContext = $context1; |
||
| 12 | foreach ($context2 as $key => $value) { |
||
| 13 | if (is_numeric($key)) { |
||
| 14 | $finalContext[] = $value; |
||
| 15 | continue; |
||
| 16 | } |
||
| 17 | |||
| 18 | if (isset($finalContext[$key]) && is_array($finalContext[$key]) && is_array($value)) { |
||
| 19 | $finalContext[$key] = $this->mergeContexts($finalContext[$key], $value); |
||
| 20 | continue; |
||
| 21 | } |
||
| 22 | $finalContext[$key] = $value; |
||
| 23 | } |
||
| 24 | return $finalContext; |
||
| 25 | } |
||
| 26 | } |