Conditions | 3 |
Paths | 3 |
Total Lines | 17 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 1 | Features | 0 |
1 | <?php |
||
12 | public function __invoke(Request $request, Response $response, Admin $app) |
||
|
|||
13 | { |
||
14 | $format = Middleware\FormatNegotiator::getFormat($request); |
||
15 | $exception = Middleware\ErrorHandler::getException($request); |
||
16 | |||
17 | if (!$exception) { |
||
18 | return $response; |
||
19 | } |
||
20 | |||
21 | if ($format === 'json') { |
||
22 | return json_encode([ |
||
23 | 'error' => $exception->getMessage() |
||
24 | ]); |
||
25 | } |
||
26 | |||
27 | return $exception->getMessage(); |
||
28 | } |
||
29 | } |
||
30 |
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.