private function handlePipeline(MatchablePipelineCollectionInterface $pipelines): ?ResponseInterface
    {
        /** @var MatchablePipelineInterface $pipeline */
        foreach ($pipelines as $pipeline) {
            if ($pipeline->matchBy($this->matchableRequest)) {
                $stages = \array_merge($this->stages(), $pipeline->stages());
                $pipelineResponse = $this->processor->processStages($stages, $this->matchableRequest->request());

                if ($pipelineResponse instanceof ResponseInterface) {
                    return $pipelineResponse;
                }

                $body = $this->response->getBody();
                $body->write($pipelineResponse);

                return $this->response->withBody($body);
            }
        }

        return null;
    }