public function withHost($host)
    {
        $pattern = new UriPattern();

        if ($pattern->matchHost($host)) {
            return $this->with('host', $this->normalize(strtolower($host)));
        }

        throw new \InvalidArgumentException("Invalid host '$host'");
    }
public function withHost($host)
    {
        $pattern = new UriPattern();

        if ($pattern->matchHost($host)) {
            return $this->with('host', $this->normalize(strtolower($host)));
        }

        throw new \InvalidArgumentException("Invalid host '$host'");
    }
public function withHost ( $ host ) { $ pattern = new UriPattern ( ) ; if ( $ pattern -> matchHost ( $ host ) ) { return $ this -> with ( 'host' , $ this -> normalize ( strtolower ( $ host ) ) ) ; } throw new \ InvalidArgumentException ( "Invalid host '$host'" ) ; }
Returns a URI instance with the specified host.

An empty host can be used to remove the host. Note that since host names
are treated in a case insensitive manner, the host will be normalized
to lowercase. This method does not support international domain names and
hosts with non ascii characters are considered invalid.

@param string $host The hostname to use with the new instance
@return static A new instance with the specified host
@throws \InvalidArgumentException If the hostname is invalid
Returns a URI instance with the specified host .