This approach by using a template method pattern ensures you that
each subclass will not forget to call the successor

@param RequestInterface $request

@return string|null
766272
final public function handle(RequestInterface $request)
    {
        $processed = $this->processing($request);

        if ($processed === null) {
            // the request has not been processed by this handler => see the next
            if ($this->successor !== null) {
                $processed = $this->successor->handle($request);
            }
        }

        return $processed;
    }
23120
public static function getPath( RequestInterface $request ) {
		$url = $request->getUrl();
		$relative_url = substr( $url, strlen( home_url( '/' ) ) );
		$relative_url = static::addLeadingSlash( $relative_url );
		$relative_url = preg_replace( '~\?.*~', '', $relative_url );
		$relative_url = static::addTrailingSlash( $relative_url );
		return $relative_url;
	}
490124
public function modify(RequestInterface $request) : RequestInterface
    {
        /** @var RequestModifierInterface $modifier */
        foreach ($this->collection as $modifier) {
            $request = $modifier->modify($request);
        }

        return $request;
    }
916963
public function toString(RequestInterface $request)
    {
        $string = sprintf(
            "%s %s HTTP/%s\n",
            $request->getMethod(),
            $request->getRequestTarget(),
            $request->getProtocolVersion()
        );

        $string .= $this->headersAndBody($request);

        return $string;
    }
508968
public function execute(RequestInterface $request): ResponseInterface
    {
        $this->supports($request);

        if ($request instanceof InputInterface) {
            $request->validate();
        }

        $client = $this->getClient();

        $data = array_replace($request->toArray(), [
            'carrier' => $client->getCarrier(),
            'key'     => $client->getKey(),
        ]);

        $response = $client->call($this->getMethodName(), $data);

        return $this->parseResponse($response->getBody()->getContents());
    }
601340
public function filterRequest(RequestInterface $request)
    {
        if ($this->pattern->matchRequest($request)) {
            $this->securityInterceptor->invoke();
            return true;
        }
        return false;
    }
149003
private function getRootFilter(RequestInterface $request)
    {
        $filter = null;

        if ($request->getFilter()) {
            $filter = $this->queryBuilder->buildQuery($request->getFilter());
        }

        return $filter;
    }
1151055
protected function configureRequest(RequestInterface $Request)
    {
        if ($Request->getStatus() >= Curl::STATUS_SENT){
            $Request->reset();
        }
        if (isset($this->properties[self::PROPERTY_HTTP_METHOD]) &&
            $this->properties[self::PROPERTY_HTTP_METHOD] !== ''){
            $Request->setMethod($this->properties[self::PROPERTY_HTTP_METHOD]);
        }
        $url = $this->configureURL($this->getOptions());
        if ($this->verifyUrl($url)) {
            $url = rtrim($this->getBaseUrl(),"/")."/".$url;
            $Request->setURL($url);
        }
        $data = ($this->getData()?$this->getData():NULL);
        $data = $this->configureData($data);
        $Request->setBody($data);
        if ($this->authRequired()){
            if (isset($this->Auth)){
                $this->Auth->configureRequest($Request);
            }
        }
        return $Request;
    }
762845
public function next(RequestInterface $request)
    {
        if (!count($this->processingStack) && $this->responseSourceDelegate) {
            return $this->responseSourceDelegate->next($request);
        }
        return parent::next($request);
    }
430297
public function request(RequestInterface $request)
    {
        $response = $this->httpClient->sendRequest($request);
        $data = $this->decodeResponse($response);
        $this->detectError($data);

        return $data;
    }
592149
public function next(RequestInterface $request)
    {
        if (!count($this->processingStack)) {
            throw new \RuntimeException('No middleware response created for stack.');
        }
        if (!($request instanceof ServerRequestInterface)) {
            throw new \InvalidArgumentException();
        }
        /** @var ServerMiddlewareInterface $middleware */
        $middleware = array_shift($this->processingStack);
        return $middleware->process($request, $this);
    }
880779
public function getLastRequestTime(RequestInterface $request)
    {
        $route = $this->getRoute($request);

        if (isset($this->routes[$route])) {
            return isset($this->routes[$route]['lastRequest']) ? $this->routes[$route]['lastRequest'] : null;
        }
    }
201021
public function getRoute(RequestInterface $request)
    {
        $route = $request->getUri()->__toString();
        if ($request->getMethod() === 'DELETE' && strpos($request->getUri(), 'messages') !== false) {
            $route = 'DELETE-'.$request->getUri();
        }

        return $route;
    }
325303
public function decorate(RequestInterface $request)
    {
        return $request->withHeader($this->headerName, $this->requestIdProvider->getRequestId());
    }
202874
protected function process(RequestInterface $request, string $responseClassName = null): ?ResponseInterface
    {
        $context = SerializationContext::create();

        $request = $this->serializer->serialize($request, $this->serializerFormat, $context);

        $response = $this->httpClient->post('', ['body' => $request]);

        if (!$responseClassName) {
            return null;
        }

        return $this->serializer->deserialize($response->getBody(), $responseClassName, $this->deserializerFormat);
    }
364042
public function onRequest( RequestInterface $request ) {
        $localizedUri = Uri::withQueryValue( $request->getUri(), 'lang', $this->getEndpoint()->getLang() );
        return $request->withUri($localizedUri);
    }
287066
public function sendAsync(RequestInterface $request)
    {
        return $this->httpClient->sendAsync($request)->then(
            function (ResponseInterface $response) use ($request) {
                return $request->getRpcId() ? $response : null;
            }
        );
    }