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 Setup Failed
Push — master ( 78f8b7...0f754d )
by Elemér
04:15
created

Arrays::mergeRecursive()   A

Complexity

Conditions 5
Paths 7

Size

Total Lines 9

Duplication

Lines 0
Ratio 0 %

Importance

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