returns True if the $host is defined

@param  string  $host

@return boolean
960609
public function hasHost($host)
    {
        $this->processFile($this->getFile());

        return array_key_exists($host, $this->hosts);
    }
8030
protected function setHost($host)
    {
        $host = strtolower($host);
        
        if ($host !== '' && !$this->isValidDomain($host) && !$this->isValidIpv4($host) && !$this->isValidIpv6($host)) {
            throw new \InvalidArgumentException("Invalid hostname '$host'");
        }
        
        $this->host = $host;
    }
1178532
public function removeHost($host)
    {
        if (isset($this->hosts[$host])) {
            unset($this->hosts[$host]);
        }

        return $this;
    }
148037
public static function isValidHost($host)
    {
        //Simple syntax limits
        if (empty($host)
            or !is_string($host)
            or strlen($host) > 256
        ) {
            return false;
        }
        //Looks like a bracketed IPv6 address
        if (trim($host, '[]') != $host) {
            return (bool) filter_var(trim($host, '[]'), FILTER_VALIDATE_IP, FILTER_FLAG_IPV6);
        }
        //If removing all the dots results in a numeric string, it must be an IPv4 address.
        //Need to check this first because otherwise things like `999.0.0.0` are considered valid host names
        if (is_numeric(str_replace('.', '', $host))) {
            //Is it a valid IPv4 address?
            return (bool) filter_var($host, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4);
        }
        if (filter_var('http://' . $host, FILTER_VALIDATE_URL)) {
            //Is it a syntactically valid hostname?
            return true;
        }

        return false;
    }
963009
public static boolean isHostInNetworkCard(String host) {
        try {
            InetAddress addr = InetAddress.getByName(host);
            return NetworkInterface.getByInetAddress(addr) != null;
        } catch (Exception e) {
            return false;
        }
    }
1175673
private function formatHost(?string $host): ?string
    {
        if (null === $host || '' === $host) {
            return $host;
        }

        if ('[' !== $host[0]) {
            return $this->formatRegisteredName($host);
        }

        return $this->formatIp($host);
    }
770891
public function validateHost($host = null)
    {
        if ($host === null) {
            $parsed = parse_url($this->uri);
            $host = isset($parsed['host']) ? $parsed['host'] : $parsed['path'];
        }
        return (
            preg_match("/^([a-z\d](-*[a-z\d])*)(\.([a-z\d](-*[a-z\d])*))*$/i", $host) //valid chars check
            && preg_match("/^.{1,253}$/", $host) //overall length check
            && preg_match("/^[^\.]{1,63}(\.[^\.]{1,63})*$/", $host) //length of each label
            && !$this->validateIP($host)
        );
    }
31886
public static function isInternal($url)
	{
		$current = self::getInstance()->toString(['scheme', 'host']);
		$given   = self::getInstance($url);
		$base    = $given->toString(['scheme', 'host', 'path']);
		$host    = $given->toString(['scheme', 'host']);

		if (stripos($base, $current) !== 0 && !empty($host))
		{
			return false;
		}
		return true;
	}
843913
public static boolean isLocalHost(String host) {
        return StringUtils.isNotBlank(host)
            && (LOCAL_IP_PATTERN.matcher(host).matches() || "localhost".equalsIgnoreCase(host));
    }
37514
static boolean isInvalidLocalHost(String host) {
        return StringUtils.isBlank(host)
            || isAnyHost(host)
            || isLocalHost(host);
    }
235186
public function addHost(Host $host)
    {
        if (empty($host)) return $this;

        $this->_host_list["{$host->name}:{$host->port}"] = $host;

        return $this;
    }
340659
public function removeHost(string $host)
	{
		$host = Host::filter($host);
		if( $this->offsetExists($host) ) unset( $this->hosts[$host] );
		return $this;
	}
1036351
protected function matchHost($host)
    {
        if (empty($this->host)) {
            return true;
        }

        $host = preg_replace('/^[^:]+:\/\//i', '', $host);
        $regex = str_replace('\{basename\}', '.*', preg_quote($this->host));

        return preg_match('/^' . $regex . '$/i', $host);
    }
1298132
public function addHost($host)
    {
        if (!isset($this->hosts[$host])) {
            $this->hosts[$host] = $host;
        }

        return $this;
    }
346427
public function host($host = null)
    {
        if (func_num_args() === 0) {
            $scheme = $this->_classes['scheme'];
            $port = $scheme::port($this->_scheme) !== $this->_port ? $this->_port : null;
            return ($port !== null ? "{$this->_host}:{$port}" : $this->_host);
        }
        if (strpos($host, ':')) {
            list($host, $port) = explode(':', $host);
            $this->port($port);
        }
        $this->_host = $host;
        $headers = $this->headers();
        $headers->prepend('Host', $this->host());
        return $this;
    }
1132249
public function host($host = null)
    {
        $this->host = empty($host) ? null : $host;

        return $this->host;
    }
881844
public function setHost($host)
    {
        if (strpos($host, ':') === false) {
            $this->host = $host;
        } else {
            list($host, $port) = explode(':', $host);
            $this->host = $host;
            $this->setPort($port);
        }

        return $this;
    }