Total Complexity | 2 |
Total Lines | 29 |
Duplicated Lines | 0 % |
Coverage | 22.22% |
Changes | 0 |
1 | <?php |
||
21 | class NotFoundMiddleware extends Plugin implements MiddlewareInterface |
||
22 | { |
||
23 | use ResponseTrait; |
||
24 | |||
25 | /** |
||
26 | * Checks if the resource was found |
||
27 | */ |
||
28 | public function beforeNotFound() |
||
29 | { |
||
30 | $apiResponse = new Response(); |
||
31 | $this->halt( |
||
32 | $this->application, |
||
33 | Response::NOT_FOUND, |
||
34 | $apiResponse->getHttpCodeDescription($apiResponse::NOT_FOUND) |
||
35 | ); |
||
36 | |||
37 | return false; |
||
38 | } |
||
39 | |||
40 | /** |
||
41 | * Call me |
||
42 | * |
||
43 | * @param Micro $api |
||
44 | * |
||
45 | * @return bool |
||
46 | */ |
||
47 | 2 | public function call(Micro $api) |
|
50 | } |
||
51 | } |
||
52 |