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.

ArrayUtils::isArrayAssoc()   B
last analyzed

Complexity

Conditions 6
Paths 4

Size

Total Lines 13
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 13
rs 8.8571
c 0
b 0
f 0
cc 6
eloc 7
nc 4
nop 2
1
<?php
2
/**
3
 * This file is part of the Global Trading Technologies Ltd workflow-extension-bundle package.
4
 *
5
 * For the full copyright and license information, please view the LICENSE
6
 * file that was distributed with this source code.
7
 *
8
 * (c) fduch <[email protected]>
9
 *
10
 * Date: 22.09.16
11
 */
12
13
namespace Gtt\Bundle\WorkflowExtensionsBundle\Utils;
14
15
/**
16
 * Service array utils
17
 *
18
 * @author fduch <[email protected]>
19
 */
20
class ArrayUtils
21
{
22
    /**
23
     * Recursively checks that passed array is associative or not
24
     *
25
     * @param array $array          input array
26
     * @param bool  $recursiveCheck whether to perform recursive check or not
27
     *
28
     * @return bool
29
     */
30
    public static function isArrayAssoc(array $array, $recursiveCheck = true)
31
    {
32
        foreach ($array as $key => $value) {
33
            if (is_string($key)) {
34
                return true;
35
            }
36
            if ($recursiveCheck && is_array($value) && static::isArrayAssoc($value)) {
37
                return true;
38
            }
39
        }
40
41
        return false;
42
    }
43
}