<?php
namespace App\GlobalFav\EventListener;
use App\GlobalFav\Service\GlobalFavFacade;
use Symfony\Component\EventDispatcher\Attribute\AsEventListener;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Symfony\Component\HttpKernel\Event\ResponseEvent;
#[AsEventListener]
class GlobalFavEventListener
{
private GlobalFavFacade $globalFavFacade;
public function __construct(GlobalFavFacade $globalFavFacade)
{
$this->globalFavFacade = $globalFavFacade;
}
public function __invoke(ResponseEvent $event)
{
$this->globalFavFacade->updateCookie($event->getResponse());
}
}