Skip to content

Commit

Permalink
Stop using deprecated event classes
Browse files Browse the repository at this point in the history
  • Loading branch information
javiereguiluz committed Jun 11, 2019
1 parent 8ed898f commit 948b0f7
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/EventSubscriber/CheckRequirementsSubscriber.php
Expand Up @@ -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;

/**
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/EventSubscriber/CommentNotificationSubscriber.php
Expand Up @@ -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.
Expand Down
4 changes: 2 additions & 2 deletions src/EventSubscriber/ControllerSubscriber.php
Expand Up @@ -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;

/**
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/EventSubscriber/RedirectToPreferredLocaleSubscriber.php
Expand Up @@ -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;

Expand Down Expand Up @@ -60,7 +60,7 @@ public static function getSubscribedEvents(): array
];
}

public function onKernelRequest(GetResponseEvent $event): void
public function onKernelRequest(RequestEvent $event): void
{
$request = $event->getRequest();

Expand Down

0 comments on commit 948b0f7

Please sign in to comment.