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   A

Complexity

Total Complexity 7

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 83.33%

Importance

Changes 0
Metric Value
dl 0
loc 31
ccs 20
cts 24
cp 0.8333
rs 10
c 0
b 0
f 0
wmc 7
lcom 0
cbo 1

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 10 2
B getParentFileName() 0 17 5
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