Total Complexity | 2 |
Total Lines | 29 |
Duplicated Lines | 0 % |
Coverage | 100% |
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 | 1 | public function beforeNotFound() |
|
29 | { |
||
30 | 1 | $apiResponse = new Response(); |
|
31 | 1 | $this->halt( |
|
32 | 1 | $this->application, |
|
33 | 1 | Response::NOT_FOUND, |
|
34 | 1 | $apiResponse->getHttpCodeDescription($apiResponse::NOT_FOUND) |
|
35 | ); |
||
36 | |||
37 | 1 | 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 |