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