private function getHostWithScheme(UriInterface $url)
    {
        $target = new Uri();
        $target = $target
            ->withScheme($url->getScheme())
            ->withHost($url->getHost())
            ->withPort($url->getPort());

        return (string) $target;
    }