Skip to content

Commit 2a83a63

Browse files
committed
minor #999 Stop using deprecated event classes (javiereguiluz)
This PR was merged into the master branch. Discussion ---------- Stop using deprecated event classes Commits ------- 948b0f7 Stop using deprecated event classes
2 parents badac21 + 948b0f7 commit 2a83a63

4 files changed

+7
-7
lines changed

src/EventSubscriber/CheckRequirementsSubscriber.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
use Symfony\Component\Console\Event\ConsoleErrorEvent;
1818
use Symfony\Component\Console\Style\SymfonyStyle;
1919
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
20-
use Symfony\Component\HttpKernel\Event\GetResponseForExceptionEvent;
20+
use Symfony\Component\HttpKernel\Event\ExceptionEvent;
2121
use Symfony\Component\HttpKernel\KernelEvents;
2222

2323
/**
@@ -73,7 +73,7 @@ public function handleConsoleError(ConsoleErrorEvent $event): void
7373
* This method checks if the triggered exception is related to the database
7474
* and then, it checks if the required 'sqlite3' PHP extension is enabled.
7575
*/
76-
public function handleKernelException(GetResponseForExceptionEvent $event): void
76+
public function handleKernelException(ExceptionEvent $event): void
7777
{
7878
$exception = $event->getException();
7979
// Since any exception thrown during a Twig template rendering is wrapped

src/EventSubscriber/CommentNotificationSubscriber.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
use App\Events\CommentCreatedEvent;
1616
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
1717
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
18-
use Symfony\Component\Translation\TranslatorInterface;
18+
use Symfony\Contracts\Translation\TranslatorInterface;
1919

2020
/**
2121
* Notifies post's author about new comments.

src/EventSubscriber/ControllerSubscriber.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
use App\Twig\SourceCodeExtension;
1515
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
16-
use Symfony\Component\HttpKernel\Event\FilterControllerEvent;
16+
use Symfony\Component\HttpKernel\Event\ControllerEvent;
1717
use Symfony\Component\HttpKernel\KernelEvents;
1818

1919
/**
@@ -39,7 +39,7 @@ public static function getSubscribedEvents(): array
3939
];
4040
}
4141

42-
public function registerCurrentController(FilterControllerEvent $event): void
42+
public function registerCurrentController(ControllerEvent $event): void
4343
{
4444
// this check is needed because in Symfony a request can perform any
4545
// number of sub-requests. See

src/EventSubscriber/RedirectToPreferredLocaleSubscriber.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
1515
use Symfony\Component\HttpFoundation\RedirectResponse;
16-
use Symfony\Component\HttpKernel\Event\GetResponseEvent;
16+
use Symfony\Component\HttpKernel\Event\RequestEvent;
1717
use Symfony\Component\HttpKernel\KernelEvents;
1818
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
1919

@@ -60,7 +60,7 @@ public static function getSubscribedEvents(): array
6060
];
6161
}
6262

63-
public function onKernelRequest(GetResponseEvent $event): void
63+
public function onKernelRequest(RequestEvent $event): void
6464
{
6565
$request = $event->getRequest();
6666

0 commit comments

Comments
 (0)