public static function getHostname(string $url)
    {
        $url = UrlHelper::validateUrl($url);

        $hostname = parse_url($url, PHP_URL_HOST);
        if ($hostname === false) {
            throw new InvalidArgumentException("Could not determine hostname, url seems to be invalid: $url");
        }

        return $hostname;
    }