Conditions | 3 |
Paths | 3 |
Total Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Tests | 3 |
CRAP Score | 4.125 |
Changes | 0 |
1 | <?php |
||
15 | 1 | public function render(\Exception $e) |
|
16 | { |
||
17 | 1 | if($e instanceof HttpException){ |
|
18 | 1 | return new Response($e->getMessage(), $e->getStatusCode(), $e->getHeaders()); |
|
19 | } if($e instanceof \InvalidArgumentException){ |
||
20 | return new Response($e->getMessage(), Response::HTTP_BAD_REQUEST); |
||
21 | }else{ |
||
22 | return new Response($e->getMessage(), Response::HTTP_INTERNAL_SERVER_ERROR); |
||
23 | } |
||
24 | } |
||
25 | } |