src/Middleware/CallableMiddlewareDecorator.php
public function process(ServerRequestInterface $request, RequestHandlerInterface $requestHandler): ResponseInterface
    {
        $response = call_user_func_array($this->middleware, [$request, $requestHandler]);

        if (!$response instanceof ResponseInterface) {
            throw new \RuntimeException('No valid response sending.');
        }

        return $response;
    }
public function process(ServerRequestInterface $request, RequestHandlerInterface $requestHandler): ResponseInterface
    {
        $response = call_user_func_array($this->middleware, [$request, $requestHandler]);

        if (!$response instanceof ResponseInterface) {
            throw new \RuntimeException('No valid response sending.');
        }

        return $response;
    }
Process an incoming server request and return a response, optionally delegating
to the next middleware component to create the response.

@param ServerRequestInterface  $request
@param RequestHandlerInterface $requestHandler

@return ResponseInterface