core-bundle/src/EventListener/BypassMaintenanceListener.php
public function onKernelRequest(GetResponseEvent $event): void
    {
        if (!$this->tokenChecker->hasBackendUser()) {
            return;
        }

        $request = $event->getRequest();
        $request->attributes->set($this->requestAttribute, true);
    }
public function onKernelRequest(GetResponseEvent $event): void
    {
        if (!$this->tokenChecker->hasBackendUser()) {
            return;
        }

        $request = $event->getRequest();
        $request->attributes->set($this->requestAttribute, true);
    }
Adds the request attribute to the request.