1 | <?php |
||
26 | class Handler extends ExceptionHandler |
||
27 | { |
||
28 | /** |
||
29 | * Список исключений, которые являются частью нормальной работы приложения |
||
30 | * и которые не надо как-то обрабатывать. Например, "ошибка 404" и прочие. |
||
31 | * @var array |
||
32 | */ |
||
33 | protected $dontReport = [ |
||
34 | \Illuminate\Auth\AuthenticationException::class, |
||
35 | \Illuminate\Auth\Access\AuthorizationException::class, |
||
36 | \Symfony\Component\HttpKernel\Exception\HttpException::class, |
||
37 | \Illuminate\Database\Eloquent\ModelNotFoundException::class, |
||
38 | \Illuminate\Session\TokenMismatchException::class, |
||
39 | \Illuminate\Validation\ValidationException::class, |
||
40 | ]; |
||
41 | |||
42 | /** |
||
43 | * Метод, куда прилетают все наши исключения для обработки. |
||
44 | * Отличное место для отправки оных в Sentry, Bugsnag, и проч. |
||
45 | * @param \Exception $exception |
||
46 | * @throws \Exception |
||
47 | */ |
||
48 | public function report(\Exception $exception): void |
||
56 | |||
57 | /** |
||
58 | * Отображение наших необработанных ошибок. |
||
59 | * @param \Illuminate\Http\Request $request |
||
60 | * @param \Exception $exception |
||
61 | * @return string|\Symfony\Component\HttpFoundation\Response |
||
62 | * @throws \Throwable |
||
63 | * @throws \InvalidArgumentException |
||
64 | */ |
||
65 | public function render($request, \Exception $exception) |
||
88 | |||
89 | /** |
||
90 | * @param HttpException $exception |
||
91 | * @return array |
||
92 | */ |
||
93 | private function getError(HttpException $exception): array |
||
104 | |||
105 | /** |
||
106 | * @param HttpException $exception |
||
107 | * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View |
||
108 | */ |
||
109 | private function getErrorView(HttpException $exception) |
||
115 | |||
116 | /** |
||
117 | * Преобразовываем ошибки аутентификации в разлогинивающий ответ. |
||
118 | * @param \Illuminate\Http\Request $request |
||
119 | * @param \Illuminate\Auth\AuthenticationException $exception |
||
120 | * @return Response|RedirectResponse |
||
121 | */ |
||
122 | protected function unauthenticated($request, AuthenticationException $exception) |
||
131 | |||
132 | /** |
||
133 | * @param HttpException $exception |
||
134 | * @return array |
||
135 | */ |
||
136 | private function getDebugError(HttpException $exception): array |
||
148 | } |
||
149 |
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: