| Conditions | 3 |
| Paths | 3 |
| Total Lines | 10 |
| Code Lines | 5 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 6 |
| CRAP Score | 3 |
| Changes | 1 | ||
| Bugs | 1 | Features | 0 |
| 1 | <?php |
||
| 14 | 28 | public function resolve(string $className): RuleHandlerInterface |
|
| 15 | { |
||
| 16 | 28 | if (!array_key_exists($className, $this->instances)) { |
|
| 17 | 28 | if (!is_subclass_of($className, RuleHandlerInterface::class)) { |
|
| 18 | 1 | throw new RuleHandlerInterfaceNotImplementedException($className); |
|
| 19 | } |
||
| 20 | 27 | return $this->instances[$className] = new $className(); |
|
| 21 | } |
||
| 22 | |||
| 23 | 6 | return $this->instances[$className]; |
|
| 24 | } |
||
| 26 |