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.

ClassModifiedChecker::getParentFileName()   A
last analyzed

Complexity

Conditions 5
Paths 7

Size

Total Lines 17

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 11
CRAP Score 5.4742

Importance

Changes 0
Metric Value
cc 5
nc 7
nop 2
dl 0
loc 17
ccs 11
cts 15
cp 0.7332
crap 5.4742
rs 9.3888
c 0
b 0
f 0
1
<?php
2
3
namespace PhpBoot\Cache;
4
5
class ClassModifiedChecker extends FileModifiedChecker
6
{
7 21
    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 21
        $class = new \ReflectionClass($className);
9 21
        $files = [];
10
11 21
        if($class->getFileName()){
12 21
            $files[] = $class->getFileName();
13 21
            self::getParentFileName($class, $files);
14 21
        }
15 21
        parent::__construct($files);
16 21
    }
17
18 21
    static public function getParentFileName(\ReflectionClass $class, array &$files)
19
    {
20 21
        $parent = $class->getParentClass();
21 21
        if(!$parent){
22 21
            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