From 948b0f7b0ffd67c850f287bbed33f52d46b473d7 Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Tue, 11 Jun 2019 10:29:13 +0200 Subject: [PATCH] Stop using deprecated event classes --- src/EventSubscriber/CheckRequirementsSubscriber.php | 4 ++-- src/EventSubscriber/CommentNotificationSubscriber.php | 2 +- src/EventSubscriber/ControllerSubscriber.php | 4 ++-- src/EventSubscriber/RedirectToPreferredLocaleSubscriber.php | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/EventSubscriber/CheckRequirementsSubscriber.php b/src/EventSubscriber/CheckRequirementsSubscriber.php index 241c80a1a..22bd77417 100644 --- a/src/EventSubscriber/CheckRequirementsSubscriber.php +++ b/src/EventSubscriber/CheckRequirementsSubscriber.php @@ -17,7 +17,7 @@ use Symfony\Component\Console\Event\ConsoleErrorEvent; use Symfony\Component\Console\Style\SymfonyStyle; use Symfony\Component\EventDispatcher\EventSubscriberInterface; -use Symfony\Component\HttpKernel\Event\GetResponseForExceptionEvent; +use Symfony\Component\HttpKernel\Event\ExceptionEvent; use Symfony\Component\HttpKernel\KernelEvents; /** @@ -73,7 +73,7 @@ public function handleConsoleError(ConsoleErrorEvent $event): void * This method checks if the triggered exception is related to the database * and then, it checks if the required 'sqlite3' PHP extension is enabled. */ - public function handleKernelException(GetResponseForExceptionEvent $event): void + public function handleKernelException(ExceptionEvent $event): void { $exception = $event->getException(); // Since any exception thrown during a Twig template rendering is wrapped diff --git a/src/EventSubscriber/CommentNotificationSubscriber.php b/src/EventSubscriber/CommentNotificationSubscriber.php index c2756e2ba..5f3b8ba81 100644 --- a/src/EventSubscriber/CommentNotificationSubscriber.php +++ b/src/EventSubscriber/CommentNotificationSubscriber.php @@ -15,7 +15,7 @@ use App\Events\CommentCreatedEvent; use Symfony\Component\EventDispatcher\EventSubscriberInterface; use Symfony\Component\Routing\Generator\UrlGeneratorInterface; -use Symfony\Component\Translation\TranslatorInterface; +use Symfony\Contracts\Translation\TranslatorInterface; /** * Notifies post's author about new comments. diff --git a/src/EventSubscriber/ControllerSubscriber.php b/src/EventSubscriber/ControllerSubscriber.php index 7848efe46..e36d7ca93 100644 --- a/src/EventSubscriber/ControllerSubscriber.php +++ b/src/EventSubscriber/ControllerSubscriber.php @@ -13,7 +13,7 @@ use App\Twig\SourceCodeExtension; use Symfony\Component\EventDispatcher\EventSubscriberInterface; -use Symfony\Component\HttpKernel\Event\FilterControllerEvent; +use Symfony\Component\HttpKernel\Event\ControllerEvent; use Symfony\Component\HttpKernel\KernelEvents; /** @@ -39,7 +39,7 @@ public static function getSubscribedEvents(): array ]; } - public function registerCurrentController(FilterControllerEvent $event): void + public function registerCurrentController(ControllerEvent $event): void { // this check is needed because in Symfony a request can perform any // number of sub-requests. See diff --git a/src/EventSubscriber/RedirectToPreferredLocaleSubscriber.php b/src/EventSubscriber/RedirectToPreferredLocaleSubscriber.php index 602536208..af74253a8 100644 --- a/src/EventSubscriber/RedirectToPreferredLocaleSubscriber.php +++ b/src/EventSubscriber/RedirectToPreferredLocaleSubscriber.php @@ -13,7 +13,7 @@ use Symfony\Component\EventDispatcher\EventSubscriberInterface; use Symfony\Component\HttpFoundation\RedirectResponse; -use Symfony\Component\HttpKernel\Event\GetResponseEvent; +use Symfony\Component\HttpKernel\Event\RequestEvent; use Symfony\Component\HttpKernel\KernelEvents; use Symfony\Component\Routing\Generator\UrlGeneratorInterface; @@ -60,7 +60,7 @@ public static function getSubscribedEvents(): array ]; } - public function onKernelRequest(GetResponseEvent $event): void + public function onKernelRequest(RequestEvent $event): void { $request = $event->getRequest();