Conditions | 2 |
Paths | 2 |
Total Lines | 16 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Tests | 11 |
CRAP Score | 2 |
Changes | 0 |
1 | <?php |
||
15 | 79 | protected function getMatchingClassNameIn($object, array $classList) : ?string |
|
16 | { |
||
17 | 79 | $actualClassList = array_merge( |
|
18 | 79 | [get_class($object)], |
|
19 | 79 | class_implements($object), |
|
20 | 79 | class_uses($object) |
|
21 | ); |
||
22 | 79 | $parentClass = get_parent_class($object); |
|
23 | 79 | while (false !== $parentClass) { |
|
24 | 79 | $actualClassList[] = $parentClass; |
|
25 | 79 | $parentClass = get_parent_class($parentClass); |
|
26 | } |
||
27 | |||
28 | 79 | $matchList = array_intersect($actualClassList, $classList); |
|
29 | |||
30 | 79 | return array_pop($matchList); |
|
31 | } |
||
33 |