Conditions | 4 |
Paths | 4 |
Total Lines | 13 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Tests | 7 |
CRAP Score | 4 |
Changes | 0 |
1 | <?php |
||
38 | 8 | private function findParentScope(/*object */$target, string $property): string |
|
39 | { |
||
40 | 8 | $class = \get_parent_class($target); |
|
41 | |||
42 | 8 | while (!\property_exists($class, $property) && $parent = \get_parent_class($class)) { |
|
43 | 3 | $class = $parent; |
|
44 | } |
||
45 | |||
46 | 8 | if (!\property_exists($class, $property)) { |
|
47 | 1 | throw new \LogicException(\sprintf('The property "%s::%s" does not exist.', \get_class($target), $property)); |
|
48 | } |
||
49 | |||
50 | 7 | return $class; |
|
51 | } |
||
53 |