1 | <?php |
||
16 | class Handler extends ExceptionHandler |
||
17 | { |
||
18 | /** |
||
19 | * A list of the exception types that should not be reported. |
||
20 | * |
||
21 | * @var array |
||
22 | */ |
||
23 | protected $dontReport = [ |
||
24 | \Illuminate\Auth\AuthenticationException::class, |
||
25 | \Illuminate\Auth\Access\AuthorizationException::class, |
||
26 | \Symfony\Component\HttpKernel\Exception\HttpException::class, |
||
27 | \Illuminate\Database\Eloquent\ModelNotFoundException::class, |
||
28 | \Illuminate\Session\TokenMismatchException::class, |
||
29 | \Illuminate\Validation\ValidationException::class, |
||
30 | ]; |
||
31 | |||
32 | /** |
||
33 | * Report or log an exception. |
||
34 | * |
||
35 | * This is a great spot to send exceptions to Sentry, Bugsnag, etc. |
||
36 | * |
||
37 | * @param \Exception $exception |
||
38 | * |
||
39 | * @return void |
||
40 | */ |
||
41 | public function report(Exception $exception) |
||
45 | |||
46 | /** |
||
47 | * Render an exception into an HTTP response. |
||
48 | * |
||
49 | * @param \Illuminate\Http\Request $request |
||
50 | * @param \Exception $exception |
||
51 | * |
||
52 | * @return \Illuminate\Http\Response |
||
53 | */ |
||
54 | public function render($request, Exception $exception) |
||
64 | |||
65 | /** |
||
66 | * Convert an authentication exception into an unauthenticated response. |
||
67 | * |
||
68 | * @param \Illuminate\Http\Request $request |
||
69 | * @param \Illuminate\Auth\AuthenticationException $exception |
||
70 | * |
||
71 | * @return \Illuminate\Http\Response |
||
|
|||
72 | */ |
||
73 | protected function unauthenticated($request, AuthenticationException $exception) |
||
81 | } |
||
82 |
This check compares the return type specified in the
@return
annotation of a function or method doc comment with the types returned by the function and raises an issue if they mismatch.