| Conditions | 3 |
| Paths | 3 |
| Total Lines | 18 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 28 | private function getRulesProperty(ReflectionClass $reflectionClass): ReflectionProperty |
||
| 29 | { |
||
| 30 | if ($reflectionClass->hasProperty('_rules')) { |
||
| 31 | $_rules = $reflectionClass->getProperty('_rules'); |
||
| 32 | $_rules->setAccessible(true); |
||
| 33 | |||
| 34 | return $_rules; |
||
| 35 | } |
||
| 36 | |||
| 37 | $parent = $reflectionClass->getParentClass(); |
||
| 38 | // @codeCoverageIgnoreStart |
||
| 39 | if (! $parent) { |
||
| 40 | throw new RuntimeException("{$reflectionClass->getName()} does not have _rules and parent class"); |
||
| 41 | } |
||
| 42 | |||
| 43 | // @codeCoverageIgnoreEnd |
||
| 44 | |||
| 45 | return $this->getRulesProperty($parent); |
||
| 46 | } |
||
| 48 |