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   A
last analyzed

Complexity

Total Complexity 6

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 6
lcom 0
cbo 0
dl 0
loc 28
ccs 15
cts 15
cp 1
rs 10
c 1
b 0
f 1

1 Method

Rating   Name   Duplication   Size   Complexity  
B stdClassToArray() 0 20 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