public function onKernelRequest(GetResponseEvent $event)
    {
        $request = $event->getRequest();

        foreach ($this->requestMatchers as $requestMatcher) {
            if ($requestMatcher->matches($request)) {
                $request->attributes->set(FOSRestBundle::ZONE_ATTRIBUTE, true);

                return;
            }
        }

        $request->attributes->set(FOSRestBundle::ZONE_ATTRIBUTE, false);
    }
public function onKernelRequest(GetResponseEvent $event)
    {
        $request = $event->getRequest();

        foreach ($this->requestMatchers as $requestMatcher) {
            if ($requestMatcher->matches($request)) {
                $request->attributes->set(FOSRestBundle::ZONE_ATTRIBUTE, true);

                return;
            }
        }

        $request->attributes->set(FOSRestBundle::ZONE_ATTRIBUTE, false);
    }
public function onKernelRequest ( GetResponseEvent $ event ) { $ request = $ event -> getRequest ( ) ; foreach ( $ this -> requestMatchers as $ requestMatcher ) { if ( $ requestMatcher -> matches ( $ request ) ) { $ request -> attributes -> set ( FOSRestBundle :: ZONE_ATTRIBUTE , true ) ; return ; } } $ request -> attributes -> set ( FOSRestBundle :: ZONE_ATTRIBUTE , false ) ; }
Adds an optional "_fos_rest_zone" request attribute to be checked for existence by other listeners.

@param GetResponseEvent $event
Adds an optional _fos_rest_zone request attribute to be checked for existence by other listeners .