em = $em; } /** * Process an incoming server request and return a response, optionally delegating * response creation to a handler. */ public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface { $handledRequest = $handler->handle($request); $this->em->getConnection()->close(); $this->em->clear(); return $handledRequest; } }