public function onKernelRequest(GetResponseEvent $event)
    {
        $request = $event->getRequest();
        if (!$this->isProfilerRequest($request)) {
            return;
        }

        $token = $this->session->isStarted() ? $this->session->get('authentication') : null;
        if ($this->debug && ($token instanceof Token || $this->debugLoggedOff)) {
            return;
        }

        throw new NotFoundHttpException();
    }
public function onKernelRequest(GetResponseEvent $event)
    {
        $request = $event->getRequest();
        if (!$this->isProfilerRequest($request)) {
            return;
        }

        $token = $this->session->isStarted() ? $this->session->get('authentication') : null;
        if ($this->debug && ($token instanceof Token || $this->debugLoggedOff)) {
            return;
        }

        throw new NotFoundHttpException();
    }
public function onKernelRequest ( GetResponseEvent $ event ) { $ request = $ event -> getRequest ( ) ; if ( ! $ this -> isProfilerRequest ( $ request ) ) { return ; } $ token = $ this -> session -> isStarted ( ) ? $ this -> session -> get ( 'authentication' ) : null ; if ( $ this -> debug && ( $ token instanceof Token || $ this -> debugLoggedOff ) ) { return ; } throw new NotFoundHttpException ( ) ; }
Request listener to prevent access to profiler routes when debugging is
not enabled, or the user is logged off & debugging is not configured to
show when logged off.

@param GetResponseEvent $event
Request listener to prevent access to profiler routes when debugging is not enabled or the user is logged off & debugging is not configured to show when logged off .