[HttpKernel] Fix missing import in GetResponseForExceptionEvent

This commit is contained in:
Thomas Calvet 2019-11-12 10:16:20 +01:00 committed by Nicolas Grekas
parent 0b867be27b
commit bc46a3a6dd
2 changed files with 4 additions and 8 deletions

View File

@ -11,6 +11,7 @@
namespace Symfony\Component\HttpKernel\Event; namespace Symfony\Component\HttpKernel\Event;
use Symfony\Component\Debug\Exception\FatalThrowableError;
use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpKernel\HttpKernelInterface; use Symfony\Component\HttpKernel\HttpKernelInterface;

View File

@ -106,7 +106,7 @@ class ErrorListener implements EventSubscriberInterface
} }
} }
public static function getSubscribedEvents() public static function getSubscribedEvents(): array
{ {
return [ return [
KernelEvents::CONTROLLER_ARGUMENTS => 'onControllerArguments', KernelEvents::CONTROLLER_ARGUMENTS => 'onControllerArguments',
@ -119,11 +119,8 @@ class ErrorListener implements EventSubscriberInterface
/** /**
* Logs an exception. * Logs an exception.
*
* @param \Exception $exception The \Exception instance
* @param string $message The error message to log
*/ */
protected function logException(\Exception $exception, $message) protected function logException(\Throwable $exception, string $message): void
{ {
if (null !== $this->logger) { if (null !== $this->logger) {
if (!$exception instanceof HttpExceptionInterface || $exception->getStatusCode() >= 500) { if (!$exception instanceof HttpExceptionInterface || $exception->getStatusCode() >= 500) {
@ -136,10 +133,8 @@ class ErrorListener implements EventSubscriberInterface
/** /**
* Clones the request for the exception. * Clones the request for the exception.
*
* @return Request The cloned request
*/ */
protected function duplicateRequest(\Exception $exception, Request $request) protected function duplicateRequest(\Throwable $exception, Request $request): Request
{ {
$attributes = [ $attributes = [
'_controller' => $this->controller, '_controller' => $this->controller,