GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Test Failed
Push — master ( 3e189a...03d551 )
by Mewes
15:04
created

Arrays::mergeRecursive()   A

Complexity

Conditions 5
Paths 7

Size

Total Lines 9

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 6
CRAP Score 5

Importance

Changes 0
Metric Value
dl 0
loc 9
ccs 6
cts 6
cp 1
rs 9.6111
c 0
b 0
f 0
cc 5
nc 7
nop 2
crap 5
1
<?php
2
3
namespace MewesK\TwigSpreadsheetBundle\Helper;
4
5
/**
6
 * Class Arrays.
7
 */
8
class Arrays
9
{
10
    /**
11
     * Merge two arrays recursively. Works the same as 'array_merge_recursive' but will only merge array values, other
12
     * values are overridden.
13
     *
14
     * @param array $array1
15
     * @param array $array2
16
     *
17
     * @return array
18
     */
19 2
    public static function mergeRecursive(array &$array1, array &$array2): array
20
    {
21 2
        foreach ($array2 as $key => &$value) {
22 2
            $array1[$key] = \is_array($value) && isset($array1[$key]) && \is_array($array1[$key]) ?
23 2
                self::mergeRecursive($array1[$key], $value) :
24 2
                $value;
25
        }
26 2
        return $array1;
27
    }
28
}
29