src/EventListener/RequestListener.php line 30
<?php
namespace App\EventListener;
use App\Service\Translator;
use Symfony\Component\HttpKernel\Event\RequestEvent;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
class RequestListener implements EventSubscriberInterface
{
private $trans;
private $gUrl;
public function __construct(Translator $trans, UrlGeneratorInterface $g)
{
$this->trans = $trans;
$this->gUrl = $g;
}
public static function getSubscribedEvents(): array
{
return [
// the priority must be greater than the Security HTTP
// ExceptionListener, to make sure it's called before
// the default exception listener
'kernel.request' => 'onKernelRequest',
];
}
public function onKernelRequest(RequestEvent $event)
{
}
}