@param RequestHandlerInterface $requestHandler

@return callable
4570
private function createRequestHandler(RequestHandlerInterface $requestHandler)
    {
        return function (\swoole_http_request $swooleRequest, \swoole_http_response $swooleResponse) use ($requestHandler) {
            $request = $this->messageTransformer->transform($swooleRequest);
            $response = $requestHandler->handle($request);
            $this->messageTransformer->reverseTransform($response, $swooleResponse);

            $requestHandler->finish($request, $response);
        };
    }
465112
public function setHandler(string $handlerId, HandlerInterface $handler): self
    {
        $this->_handlers[$handlerId] = $handler;

        return $this;
    }
251636
public function getRequestHandlerBuilder(){
        if(null === $this->requestHandlerBuilder){
            $this->requestHandlerBuilder    = new RequestHandlerBuilder(
                $this->getContainer()
            );

            foreach($this->bundles as $bundle){
                if($bundle instanceof Bundle\MiddlewareRegisterInterface){
                    $bundle->middlewareRegister($this->requestHandlerBuilder);
                }
            }
        }

        return clone $this->requestHandlerBuilder;
    }
1005090
public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface
    {
        if (class_exists(StandardDebugBar::class)) {
            DebugBar::enable();

            DebugBar::initPDO(DB::connection()->getPdo());

            $response = $handler->handle($request);

            if ($this->shouldSendDataOnNextPage($response)) {
                DebugBar::stackData();
            } elseif ($this->shouldSendDataInHeaders($request)) {
                DebugBar::sendDataInHeaders();
            }

            return $response;
        }

        return $handler->handle($request);
    }
1272599
final protected function next(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface {
        if ($this->_next) {
            return $this->_next->process($request, $handler);
        }
        return $handler->handle($request);
    }
1012298
public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface
    {
        try {
            try {
                return $handler->handle($request);
            } catch (HttpException $exception) {
                $original_exception = $exception;

                return $this->httpExceptionResponse($request, $exception);
            } catch (Throwable $exception) {
                $original_exception = $exception;

                return $this->unhandledExceptionResponse($request, $exception);
            }
        } catch (Throwable $exception) {
            // If we can't handle the exception, rethrow it.
            throw $original_exception;
        }
    }
656888
public function create(callable $handler): callable
    {
        foreach ($this->wrappers as $wrapper) {
            $handler = $wrapper->wrap($handler);
        }

        return $handler;
    }
233054
public function process(RequestInterface $request, RequestHandlerInterface $handler)
    {
        $response = $handler->handle($request);

        $response->body()->write('World!');

        return $response;
    }
431292
private function createRequestHandler(RequestHandlerInterface $requestHandler)
    {
        return function (ReactRequest $reactRequest,  ReactResponse $reactResponse) use ($requestHandler) {
            $request = $this->messageTransformer->transform($reactRequest);
            $response = $requestHandler->handle($request);
            $this->messageTransformer->reverseTransform($response, $reactResponse);

            $requestHandler->finish($request, $response);

        };
    }
1316993
public function handle(RequestInterface $request)
    {
        $route = $this->dispatch($request);

        $handler = new ResolverHandler($this->container, $route);

        if (count($route->middlewares()) > 0)
        {
            $middlewares = (array) $route->middlewares();

            $dispatcher = new Dispatcher($middlewares, $this->container);

            return $dispatcher->process($request, $handler);
        }

        return $handler->handle($request);
    }
406627
public function pushHandler(HandlerInterface $handler)
    {
        if ($handler instanceof BaseObject) {
            array_unshift($this->handlers, $handler);
        }

        return $this;
    }
71889
public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface
    {
        $this->migration_service
            ->updateSchema('\Fisharebest\Webtrees\Schema', 'WT_SCHEMA_VERSION', Webtrees::SCHEMA_VERSION);

        return $handler->handle($request);
    }
8534
public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface
    {
       if($this->detector->isMobile()){
           $request->withAttribute('client-isMobile', TRUE);
       }
       if($this->detector->isTablet()){
           $request->withAttribute('client-isTablet', TRUE);
       }
       if($this->detector->isiOS()){
           $request->withAttribute('client-isiOS', TRUE);
       }
       if($this->detector->isiAndroidOS()){
           $request->withAttribute('client-isAndroidOS', TRUE);
       }

        return($handler->handle($request));
        
    }
264229
public static function requestBuilder(callable $serializer)
    {
        return function (callable $handler) use ($serializer) {
            return function (CommandInterface $command) use ($serializer, $handler) {
                return $handler($command, $serializer($command));
            };
        };
    }
1082955
public function setRequestHandler($handler)
    {
        $this->requestHandler = $handler;

        $this->requestHandler->setUri($this->url)
            ->setMethod($this->method);

        $this->requestHandler->getUri()->setPort($this->port);

        return $this;
    }
402352
public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface
    {
        $response = Debugger::start($request);
        if ($response !== null) {
            return $response;
        }

        \ob_start();

        try {
            $response = $handler->handle($request);

            if ($this->isError($response->getStatusCode())) {
                throw new HttpErrorException(
                    $response->getReasonPhrase(),
                    $response->getStatusCode()
                );
            }

            return Debugger::writeToResponse($response);
        } catch (\Throwable $exception) {
            return Debugger::exceptionToResponse($exception);
        }
    }
615332
public function getRequest(): RequestInterface
    {
        if (is_null($this->request)) {
            if (method_exists($this, 'resolve')) {
                $this->setRequest($this->resolve(Request::class)->load());
            } else {
                $request = new Request();
                $this->setRequest($request->load());
            }
        }

        return $this->request;
    }