We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
1 | <?php |
||
12 | class Handler extends ExceptionHandler |
||
13 | { |
||
14 | /** |
||
15 | * A list of the exception types that should not be reported. |
||
16 | * |
||
17 | * @var array |
||
18 | */ |
||
19 | protected $dontReport = [ |
||
20 | \Illuminate\Auth\AuthenticationException::class, |
||
21 | \Illuminate\Auth\Access\AuthorizationException::class, |
||
22 | \Symfony\Component\HttpKernel\Exception\HttpException::class, |
||
23 | \Illuminate\Database\Eloquent\ModelNotFoundException::class, |
||
24 | \Illuminate\Session\TokenMismatchException::class, |
||
25 | \Illuminate\Validation\ValidationException::class, |
||
26 | ]; |
||
27 | |||
28 | /** |
||
29 | * A list of the inputs that are never flashed for validation exceptions. |
||
30 | * @var array |
||
31 | */ |
||
32 | protected $dontFlash = [ |
||
33 | 'password', |
||
34 | 'password_confirmation', |
||
35 | ]; |
||
36 | |||
37 | /** |
||
38 | * Report or log an exception. |
||
39 | * |
||
40 | * This is a great spot to send exceptions to Sentry, Bugsnag, etc. |
||
41 | * |
||
42 | * @param \Exception $exception |
||
43 | */ |
||
44 | public function report(Exception $exception) |
||
48 | |||
49 | /** |
||
50 | * Render an exception into an HTTP response. |
||
51 | * |
||
52 | * @param \Illuminate\Http\Request $request |
||
53 | * @param \Exception $exception |
||
54 | * |
||
55 | * @return \Illuminate\Http\Response |
||
56 | */ |
||
57 | public function render($request, Exception $exception) |
||
85 | |||
86 | /** |
||
87 | * Convert a validation exception into a JSON response. |
||
88 | * |
||
89 | * @param \Illuminate\Http\Request $request |
||
90 | * @param \Illuminate\Validation\ValidationException $exception |
||
91 | * @return \Illuminate\Http\JsonResponse |
||
92 | */ |
||
93 | protected function invalidJson($request, ValidationException $exception) |
||
97 | |||
98 | /** |
||
99 | * Convert an authentication exception into an unauthenticated response. |
||
100 | * |
||
101 | * @param \Illuminate\Http\Request $request |
||
102 | * @param \Illuminate\Auth\AuthenticationException $exception |
||
103 | * |
||
104 | * @return \Illuminate\Http\Response |
||
105 | */ |
||
106 | protected function unauthenticated($request, AuthenticationException $exception) |
||
116 | |||
117 | |||
118 | } |
||
119 |
Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.
The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.
This check looks for comments that seem to be mostly valid code and reports them.