bundles/BlockManagerBundle/EventListener/ContextListener.php
public function onKernelRequest(GetResponseEvent $event): void
    {
        if (!$event->isMasterRequest()) {
            return;
        }

        $request = $event->getRequest();
        if ($request->attributes->has('ngbmContext')) {
            $context = $request->attributes->get('ngbmContext');
            $context = is_array($context) ? $context : [];

            $this->context->add($context);

            return;
        }

        if ($request->query->has('ngbmContext')) {
            $this->context->add($this->getUriContext($request));

            return;
        }

        $this->contextBuilder->buildContext($this->context);
    }
public function onKernelRequest(GetResponseEvent $event): void
    {
        if (!$event->isMasterRequest()) {
            return;
        }

        $request = $event->getRequest();
        if ($request->attributes->has('ngbmContext')) {
            $context = $request->attributes->get('ngbmContext');
            $context = is_array($context) ? $context : [];

            $this->context->add($context);

            return;
        }

        if ($request->query->has('ngbmContext')) {
            $this->context->add($this->getUriContext($request));

            return;
        }

        $this->contextBuilder->buildContext($this->context);
    }
public function onKernelRequest ( GetResponseEvent $ event ) : void { if ( ! $ event -> isMasterRequest ( ) ) { return ; } $ request = $ event -> getRequest ( ) ; if ( $ request -> attributes -> has ( 'ngbmContext' ) ) { $ context = $ request -> attributes -> get ( 'ngbmContext' ) ; $ context = is_array ( $ context ) ? $ context : [ ] ; $ this -> context -> add ( $ context ) ; return ; } if ( $ request -> query -> has ( 'ngbmContext' ) ) { $ this -> context -> add ( $ this -> getUriContext ( $ request ) ) ; return ; } $ this -> contextBuilder -> buildContext ( $ this -> context ) ; }
Builds the context object.

If the context is available in query parameters and the URI signature is valid,
it will be used, otherwise, provided builder will be used.
Builds the context object .