Total Complexity | 4 |
Total Lines | 45 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
5 | class ResourceControllerException extends \Exception |
||
6 | { |
||
7 | /** |
||
8 | * Report the exception. |
||
9 | * |
||
10 | * @return void |
||
11 | */ |
||
12 | public function report() |
||
14 | // |
||
15 | } |
||
16 | |||
17 | /** |
||
18 | * Render the exception into an HTTP response. |
||
19 | * |
||
20 | * @param \Illuminate\Http\Request $request The request object. |
||
21 | * |
||
22 | * @return mixed |
||
23 | */ |
||
24 | public function render($request) |
||
25 | { |
||
26 | if ($request->wantsJson()) { |
||
27 | return $this->validInternalServerErrorJsonResponse($this->message); |
||
28 | } else { |
||
29 | return redirect()->back()->with(['rafflesargentina.status.error' => $this->message]); |
||
30 | } |
||
31 | } |
||
32 | |||
33 | /** |
||
34 | * Return a valid 500 Internal Server Error json response. |
||
35 | * |
||
36 | * @param string $message The response message. |
||
37 | * |
||
38 | * @return \Illuminate\Http\JsonResponse |
||
39 | */ |
||
40 | public function validInternalServerErrorJsonResponse($message = 'Error') |
||
50 | ); |
||
51 | } |
||
53 |
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.