1 | <?php namespace App\Exceptions; |
||
10 | class Handler extends ExceptionHandler |
||
11 | { |
||
12 | |||
13 | /** |
||
14 | * A list of the exception types that should not be reported. |
||
15 | * |
||
16 | * @var array |
||
17 | */ |
||
18 | protected $dontReport = [ |
||
19 | 'Symfony\Component\HttpKernel\Exception\HttpException' |
||
20 | ]; |
||
21 | |||
22 | /** |
||
23 | * Report or log an exception. |
||
24 | * |
||
25 | * This is a great spot to send exceptions to Sentry, Bugsnag, etc. |
||
26 | * |
||
27 | * @param \Exception $e |
||
28 | * @return void |
||
29 | */ |
||
30 | public function report(Exception $e) |
||
34 | |||
35 | /** |
||
36 | * Render an exception into an HTTP response. |
||
37 | * |
||
38 | * @param \Illuminate\Http\Request $request |
||
39 | * @param \Exception $e |
||
40 | * @return \Illuminate\Http\Response |
||
41 | */ |
||
42 | public function render($request, Exception $e) |
||
65 | |||
66 | /** |
||
67 | * Render an exception using Whoops. |
||
68 | * |
||
69 | * @param \Exception $e |
||
70 | * @return \Illuminate\Http\Response |
||
71 | */ |
||
72 | protected function renderExceptionWithWhoops(Exception $e) |
||
83 | |||
84 | } |
||
85 |
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.