| Total Complexity | 4 |
| Total Lines | 42 |
| Duplicated Lines | 0 % |
| Coverage | 0% |
| Changes | 0 | ||
| 1 | <?php |
||
| 13 | trait MiddlewareTrait |
||
| 14 | { |
||
| 15 | use AttachToRequestTrait; |
||
| 16 | |||
| 17 | /** |
||
| 18 | * append $middleware after this one, return the new $middlewareStack |
||
| 19 | * |
||
| 20 | * @param $middleware |
||
| 21 | * @return MiddlewarePipe |
||
| 22 | */ |
||
| 23 | public function append(MiddlewareInterface $middleware): MiddlewarePipe |
||
| 30 | } |
||
| 31 | |||
| 32 | /** |
||
| 33 | * prepend $middleware before this one, return the new $middlewareStack |
||
| 34 | * |
||
| 35 | * @param $middleware |
||
| 36 | * @return MiddlewarePipe |
||
| 37 | */ |
||
| 38 | public function prepend(MiddlewareInterface $middleware): MiddlewarePipe |
||
| 39 | { |
||
| 40 | $stack = new MiddlewarePipe(); |
||
| 41 | |||
| 42 | return $stack |
||
| 43 | ->prepend($this) |
||
| 44 | ->prepend($middleware); |
||
| 45 | } |
||
| 46 | |||
| 47 | public function when(RequestPredictionInterface $requestPrediction): MiddlewareInterface |
||
| 48 | { |
||
| 49 | return new PredictionWrapperMiddleware($this, $requestPrediction); |
||
|
1 ignored issue
–
show
|
|||
| 50 | } |
||
| 51 | |||
| 52 | public function catch (callable $catcher, string $catchClass = \Throwable::class): MiddlewareInterface |
||
| 55 | } |
||
| 56 | } |
||
| 57 |