| Conditions | 6 |
| Paths | 5 |
| Total Lines | 18 |
| Code Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 10 |
| CRAP Score | 6 |
| Changes | 0 | ||
| 1 | <?php |
||
| 34 | 3 | final protected static function arrayMerge(array $a, array $b) : array |
|
| 35 | { |
||
| 36 | 3 | foreach ($b as $key => $value) { |
|
| 37 | 3 | if (array_key_exists($key, $a)) { |
|
| 38 | 3 | if (is_int($key)) { |
|
| 39 | 2 | $a[] = $value; |
|
| 40 | 3 | } elseif (is_array($value) && is_array($a[$key])) { |
|
| 41 | 3 | $a[$key] = self::arrayMerge($a[$key], $value); |
|
| 42 | } else { |
||
| 43 | 3 | $a[$key] = $value; |
|
| 44 | } |
||
| 45 | } else { |
||
| 46 | 3 | $a[$key] = $value; |
|
| 47 | } |
||
| 48 | } |
||
| 49 | |||
| 50 | 3 | return $a; |
|
| 51 | } |
||
| 52 | } |
||
| 53 |