public function run(?ServerRequestInterface $request = null, bool $returnResponse = false)
    {
        $request = (null !== $request) ? $request : ServerRequest::fromGlobals();
        $request = $request->withAttribute('originalResponse', $this->response);
        $response = $this->dispatcher->handle($request);

        $this->log(
            $this->container,
            sprintf(
                'App::run - Response [%d] %s',
                $response->getStatusCode(),
                $response->getReasonPhrase()
            )
        );

        if (true === $returnResponse) {
            return $response;
        }

        if (PHP_SAPI === 'cli') {
            echo (string) $response->getBody();
        } else {
            \Http\Response\send($response);
        }
    }