| Conditions | 2 |
| Paths | 2 |
| Total Lines | 11 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 47 | public function middleware($middleware): self |
||
| 48 | { |
||
| 49 | // if not an instance implementing middleware interface, try to resolve the callable |
||
| 50 | if (!($middleware instanceof MiddlewareInterface)) { |
||
| 51 | $middleware = $this->getCallable($middleware); |
||
| 52 | } |
||
| 53 | |||
| 54 | $next = $this->tip; |
||
| 55 | $node = new MiddlewareNode($middleware, $next); |
||
| 56 | $this->tip = $node; |
||
| 57 | return $this; |
||
| 58 | } |
||
| 61 |