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.
Completed
Push — master ( 0268aa...3ec9bd )
by cao
05:24
created

ClassModifiedChecker::getParentFileName()   B

Complexity

Conditions 5
Paths 7

Size

Total Lines 17
Code Lines 11

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 11
CRAP Score 5.4742

Importance

Changes 0
Metric Value
cc 5
eloc 11
nc 7
nop 2
dl 0
loc 17
ccs 11
cts 15
cp 0.7332
crap 5.4742
rs 8.8571
c 0
b 0
f 0
1
<?php
2
3
namespace PhpBoot\Cache;
4
5
class ClassModifiedChecker extends FileModifiedChecker
6
{
7 20
    function __construct($className){
0 ignored issues
show
Best Practice introduced by
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
8 20
        $class = new \ReflectionClass($className);
9 20
        $files = [];
10
11 20
        if($class->getFileName()){
12 20
            $files[] = $class->getFileName();
13 20
            self::getParentFileName($class, $files);
14 20
        }
15 20
        parent::__construct($files);
16 20
    }
17
18 20
    static public function getParentFileName(\ReflectionClass $class, array &$files)
0 ignored issues
show
Coding Style introduced by
As per PSR2, the static declaration should come after the visibility declaration.
Loading history...
19
    {
20 20
        $parent = $class->getParentClass();
21 20
        if(!$parent){
22 20
            return;
23
        }
24 1
        if($parent->getFileName()){
25 1
            $files[] = $parent->getFileName();
26 1
            self::getParentFileName($parent, $files);
27 1
        }
28 1
        foreach ($class->getInterfaces() as $interface){
29
            if($interface->getFileName()){
30
                $files[] = $interface->getFileName();
31
                self::getParentFileName($interface, $files);
32
            }
33 1
        }
34 1
    }
35
}
36