src/EventSubscriber/notifiers/ExploitationGlobalVariablesSubscriber.php line 16
<?phpnamespace App\EventSubscriber\notifiers;use App\Services\notifiers\ExploitationGlobalVarService;use Symfony\Component\EventDispatcher\EventSubscriberInterface;use Symfony\Component\HttpKernel\Event\ControllerEvent;use Twig\Environment;class ExploitationGlobalVariablesSubscriber implements EventSubscriberInterface{public function __construct(private readonly ExploitationGlobalVarService $globalVarService,private readonly Environment $twig) {}public function onKernelController(ControllerEvent $event): void{$vars = $this->globalVarService->getGlobalVariables();foreach ($vars as $key => $value) {$this->twig->addGlobal($key, $value);}}public static function getSubscribedEvents(): array{return ['kernel.controller' => 'onKernelController',];}}