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.

StdClassUtils::stdClassToArray()   B
last analyzed

Complexity

Conditions 6
Paths 4

Size

Total Lines 20
Code Lines 12

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 15
CRAP Score 6

Importance

Changes 1
Bugs 0 Features 1
Metric Value
dl 0
loc 20
ccs 15
cts 15
cp 1
rs 8.8571
c 1
b 0
f 1
cc 6
eloc 12
nc 4
nop 1
crap 6
1
<?php
2
3
namespace WebservicesNl\Utils;
4
5
/**
6
 * Class StdClassUtils
7
 */
8
class StdClassUtils
9
{
10
    /**
11
     * @param \stdClass $object
12
     *
13
     * @return array
14
     */
15 1
    public static function stdClassToArray(\stdClass $object)
16
    {
17 1
        $object = (array) $object;
18 1
        foreach ($object as &$value) {
19 1
            if ($value instanceof \stdClass) {
20 1
                $value = self::stdClassToArray($value);
21 1
                continue;
22
            }
23 1
            if (is_array($value)) {
24 1
                foreach ($value as &$arrayValue) {
25 1
                    if ($arrayValue instanceof \stdClass) {
26 1
                        $arrayValue = self::stdClassToArray($arrayValue);
27 1
                        continue;
28
                    }
29 1
                }
30 1
            }
31 1
        }
32
33 1
        return $object;
34
    }
35
}
36