| Conditions | 3 |
| Paths | 3 |
| Total Lines | 10 |
| Code Lines | 5 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 20 | public function resolve(string $className): RuleHandlerInterface |
||
| 21 | { |
||
| 22 | if (!in_array($className, $this->handlers, true)) { |
||
| 23 | throw new RuleHandlerNotFoundException($className); |
||
| 24 | } |
||
| 25 | if (!is_subclass_of($className, RuleHandlerInterface::class)) { |
||
| 26 | throw new RuleHandlerInterfaceNotImplementedException($className); |
||
| 27 | } |
||
| 28 | |||
| 29 | return new $className; |
||
| 30 | } |
||
| 32 |