| Conditions | 5 |
| Paths | 3 |
| Total Lines | 12 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 7 |
| CRAP Score | 5 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 7 | 1 | public static function arrayMergeRecursiveDistinct(array &$array1, array &$array2): array |
|
| 8 | { |
||
| 9 | 1 | $merged = $array1; |
|
| 10 | 1 | foreach ($array2 as $key => &$value) { |
|
| 11 | 1 | if (is_array($value) && isset($merged[$key]) && is_array($merged[$key])) { |
|
| 12 | 1 | $merged[$key] = static::arrayMergeRecursiveDistinct($merged[$key], $value); |
|
| 13 | } else { |
||
| 14 | 1 | $merged[$key] = $value; |
|
| 15 | } |
||
| 16 | } |
||
| 17 | |||
| 18 | 1 | return $merged; |
|
| 19 | } |
||
| 21 |