Total Complexity | 2 |
Total Lines | 31 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
8 | class BadUrlException extends Exception |
||
9 | { |
||
10 | /** |
||
11 | * Constructor function. |
||
12 | * |
||
13 | * @param string $message Custom error message. |
||
14 | * @param integer $code HTTP code to return. |
||
15 | * @param \Throwable $previous The last exception thrown. |
||
16 | * |
||
17 | * @return void |
||
18 | */ |
||
19 | public function __construct(string $message = '', int $code = 0, ?\Throwable $previous = null) |
||
20 | { |
||
21 | $message = Lang::get('errors.bad_url'); |
||
22 | $code = 422; // Unprocessable entity. |
||
23 | parent::__construct($message, $code, $previous); |
||
24 | } |
||
25 | |||
26 | /** |
||
27 | * Render the exception into an HTTP response. |
||
28 | * |
||
29 | * @param \Illuminate\Http\Request $request Incoming request object. |
||
30 | * @return \Illuminate\Http\Response |
||
31 | */ |
||
32 | public function render(\Illuminate\Http\Request $request) |
||
39 | ); |
||
40 | } |
||
42 |
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.