bundle/EventListener/SetCsrfEnabledEventListener.php
public function onKernelRequest(GetResponseEvent $event): void
    {
        $event->getRequest()->attributes->set(
            'csrf_enabled',
            $this->csrfTokenManager instanceof CsrfTokenManager
        );
    }
public function onKernelRequest(GetResponseEvent $event): void
    {
        $event->getRequest()->attributes->set(
            'csrf_enabled',
            $this->csrfTokenManager instanceof CsrfTokenManager
        );
    }
public function onKernelRequest ( GetResponseEvent $ event ) : void { $ event -> getRequest ( ) -> attributes -> set ( 'csrf_enabled' , $ this -> csrfTokenManager instanceof CsrfTokenManager ) ; }
Sets the variable into request indicating if CSRF protection is enabled or not.
Sets the variable into request indicating if CSRF protection is enabled or not .