'@' . RequestHandler::class, '$middlewares' => '@backend.middlewares', ], )] RequestHandlerInterface $requestHandler, protected readonly Context $context, ) { $this->requestHandler = $requestHandler; } public function handle(ServerRequestInterface $request): ResponseInterface { $request = $request->withAttribute('applicationType', SystemEnvironmentBuilder::REQUESTTYPE_BE); // Set up the initial context $this->initializeContext(); return parent::handle($request); } /** * Initializes the Context used for accessing data and finding out the current state of the application */ protected function initializeContext(): void { $this->context->setAspect('date', new DateTimeAspect(DateTimeFactory::createFromTimestamp($GLOBALS['EXEC_TIME']))); $this->context->setAspect('visibility', new VisibilityAspect(true, true, false, true)); } }