1 | <?php |
||
11 | class Handler extends ExceptionHandler |
||
12 | { |
||
13 | protected $dontReport = [ |
||
14 | \Illuminate\Auth\AuthenticationException::class, |
||
15 | \Illuminate\Auth\Access\AuthorizationException::class, |
||
16 | \Symfony\Component\HttpKernel\Exception\HttpException::class, |
||
17 | \Illuminate\Database\Eloquent\ModelNotFoundException::class, |
||
18 | \Illuminate\Validation\ValidationException::class, |
||
19 | ]; |
||
20 | |||
21 | public function report(Exception $e) |
||
29 | |||
30 | public function render($request, Exception $e) |
||
46 | |||
47 | protected function renderExceptionWithWhoops(Exception $e): Response |
||
60 | |||
61 | /* |
||
62 | * Don't ever display sensitive data in Whoops pages. |
||
63 | */ |
||
64 | protected function unsetSensitiveData() |
||
72 | |||
73 | /** |
||
74 | * Convert an authentication exception into an unauthenticated response. |
||
75 | * |
||
76 | * @param \Illuminate\Http\Request $request |
||
77 | * @param \Illuminate\Auth\AuthenticationException $e |
||
78 | * |
||
79 | * @return \Illuminate\Http\Response |
||
80 | */ |
||
81 | protected function unauthenticated($request, AuthenticationException $e) |
||
89 | } |
||
90 |
This check looks for parameters that are defined as one type in their type hint or doc comment but seem to be used as a narrower type, i.e an implementation of an interface or a subclass.
Consider changing the type of the parameter or doing an instanceof check before assuming your parameter is of the expected type.