<?php
namespace App\EventSubscriber;
use App\Service\UserService;
use App\Service\DelaisUserConnectService;
use App\Service\SessionSaisonSportiveService;
use Symfony\Component\Security\Core\Security;
use Symfony\Component\HttpFoundation\RedirectResponse;
use Symfony\Component\HttpKernel\Event\TerminateEvent;
use Symfony\Component\HttpKernel\Event\FinishRequestEvent;
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpKernel\Event\RequestEvent;
class OnKernelRequest implements EventSubscriberInterface
{
public function __construct(
private Security $security,
private UrlGeneratorInterface $urlGenerator,
) {}
public static function getSubscribedEvents(): array
{
return [
RequestEvent::class => 'onKernelRequest'
];
}
public function onKernelRequest(RequestEvent $event):void
{
$user = $this->security->getUser();
}
}