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