| Conditions | 3 |
| Paths | 3 |
| Total Lines | 13 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 48 | private function reflect($class) |
||
| 49 | { |
||
| 50 | $obj = (new ReflectionClass($class)); |
||
| 51 | |||
| 52 | if (!$obj->isInstantiable()) { |
||
| 53 | throw new UnexpectedValueException('Rule class must be instantiable.'); |
||
| 54 | } |
||
| 55 | |||
| 56 | if (!$obj->implementsInterface(RuleInterface::class)) { |
||
| 57 | throw new UnexpectedValueException(sprintf('Rule must implement %s.', RuleInterface::class)); |
||
| 58 | } |
||
| 59 | |||
| 60 | return $obj; |
||
| 61 | } |
||
| 63 |