Total Complexity | 3 |
Total Lines | 52 |
Duplicated Lines | 0 % |
Coverage | 0% |
Changes | 0 |
1 | <?php |
||
9 | class AdminException extends Exception |
||
10 | { |
||
11 | /** |
||
12 | * @var $links A collection of links to pass to the view. |
||
|
|||
13 | */ |
||
14 | private $links; |
||
15 | |||
16 | /** |
||
17 | * Custom constructor to add additional elements to render view. |
||
18 | * |
||
19 | * @param string $message Custom error message. |
||
20 | * @param integer $code HTTP code to return. |
||
21 | * @param \Throwable $previous The last exception thrown. |
||
22 | * @param string[] $links A collection of links to send to the view. |
||
23 | * |
||
24 | * @return void |
||
25 | */ |
||
26 | public function __construct(string $message, int $code, ?\Throwable $previous = null, array $links = null) |
||
27 | { |
||
28 | $this->links = $links; |
||
29 | parent::__construct($message, $code, $previous); |
||
30 | } |
||
31 | |||
32 | /** |
||
33 | * Render the exception into an HTTP response. |
||
34 | * |
||
35 | * @param \Illuminate\Http\Request $request Incoming request object. |
||
36 | * @return \Illuminate\Http\Response|\Illuminate\Contracts\Routing\ResponseFactory |
||
37 | */ |
||
38 | public function render(\Illuminate\Http\Request $request) |
||
50 | ); |
||
51 | } |
||
52 | |||
53 | /** |
||
54 | * Override, custom exception doesn't return a status code. |
||
55 | * |
||
56 | * @return mixed |
||
57 | */ |
||
58 | public function getStatusCode() |
||
63 |