| Conditions | 4 |
| Paths | 4 |
| Total Lines | 14 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 7 |
| CRAP Score | 4.0312 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 29 | 15 | public function setResolver(Resolver|string $resolver): static |
|
| 30 | { |
||
| 31 | 15 | if (is_string($resolver) |
|
| 32 | 15 | && is_a($resolver, Resolver::class, true)) { |
|
| 33 | 15 | $resolver = new $resolver(); |
|
| 34 | } |
||
| 35 | |||
| 36 | 15 | if (!($resolver instanceof Resolver)) { |
|
| 37 | throw new \InvalidArgumentException('Resolver Class does not implement ResolverInterface.'); |
||
| 38 | } |
||
| 39 | |||
| 40 | 15 | $this->resolver = $resolver; |
|
| 41 | |||
| 42 | 15 | return $this; |
|
| 43 | } |
||
| 53 |