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.
Passed
Pull Request — master (#162)
by Yong
04:44
created

Arrays   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 13
dl 0
loc 30
ccs 16
cts 16
cp 1
rs 10
c 0
b 0
f 0
wmc 6

1 Method

Rating   Name   Duplication   Size   Complexity  
A merge() 0 22 6
1
<?php
2
3
namespace AlibabaCloud\Client\Support;
4
5
/**
6
 * Class Arrays
7
 *
8
 * @package AlibabaCloud\Client\Support
9
 */
10
class Arrays extends \Nette\Utils\Arrays
11
{
12
13
    /**
14
     * @param array $arrays
15
     *
16
     * @return array
17
     */
18 99
    public static function merge(array $arrays)
19
    {
20 99
        $result = [];
21 99
        foreach ($arrays as $array) {
22 99
            foreach ($array as $key => $value) {
23 99
                if (is_int($key)) {
24 3
                    $result[] = $value;
25 3
                    continue;
26
                }
27
28 96
                if (isset($result[$key]) && is_array($result[$key])) {
29 1
                    $result[$key] = self::merge(
30 1
                        [$result[$key], $value]
31 1
                    );
32 1
                    continue;
33
                }
34
35 96
                $result[$key] = $value;
36 99
            }
37 99
        }
38
39 99
        return $result;
40
    }
41
}
42