| Conditions | 3 |
| Paths | 3 |
| Total Lines | 11 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 6 |
| CRAP Score | 3 |
| Changes | 0 | ||
| 1 | <?php declare(strict_types=1); |
||
| 20 | 3 | public function get(string $middleware) : MiddlewareInterface |
|
| 21 | { |
||
| 22 | 3 | if ($this->container->has($middleware)) { |
|
| 23 | 3 | $instance = $this->container->get($middleware); |
|
| 24 | 3 | if ($instance instanceof MiddlewareInterface) { |
|
| 25 | 1 | return $instance; |
|
| 26 | } |
||
| 27 | } |
||
| 28 | |||
| 29 | 2 | throw new InvalidMiddlewareException(); |
|
| 30 | } |
||
| 31 | } |
||
| 32 |