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 ( 394cf2...003ff0 )
by Constantin
02:34
created

SubclassComparator::isASubClassOrSameClass()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 2
eloc 2
nc 2
nop 2
crap 2
1
<?php
2
3
4
namespace Gica\CodeAnalysis\Shared\ClassComparison;
5
6
7
class SubclassComparator
8
{
9 5
    public function isASubClass($object, string $parentClass)
10
    {
11 5
        return is_subclass_of($object, $parentClass);
0 ignored issues
show
Bug introduced by
Due to PHP Bug #53727, is_subclass_of might return inconsistent results on some PHP versions if $parentClass can be an interface. If so, you could instead use ReflectionClass::implementsInterface.
Loading history...
12
    }
13
14 3
    public function isASubClassOrSameClass($object, string $parentClass)
15
    {
16 3
        return $this->isASubClass($object, $parentClass) || $this->getObjectClass($object) === $parentClass;
17
    }
18
19 1
    public function isASubClassButNoSameClass($object, string $parentClass)
20
    {
21 1
        return $this->isASubClass($object, $parentClass) && $this->getObjectClass($object) !== $parentClass;
22
    }
23
24 4
    private function getObjectClass($object): string
25
    {
26 4
        return is_string($object) ? $object : get_class($object);
27
    }
28
}