Get the IPv4 address corresponding to a given Internet host name.

@param string $hostname
The host name.
@throws \InvalidArgumentException
@return self
@see http://php.net/manual/en/function.gethostbyname.php
507858
static function getByName(string $hostname): IPAddress {
        $host = gethostbyname($hostname);
        if ($host === $hostname) {
            throw new \InvalidArgumentException($hostname);
        }
        return new self($host);
    }
827734
public function getParameter($key) {
    if (is_string($key)) {
      return $this->getParameterByName($key);
    }
    elseif (is_integer($key)) {
      return $this->getParameterAtIndex($key);
    }
    else {
      throw new \InvalidArgumentException("Illegal parameter index {$key}.");
    }
  }
364623
public static function getProvider($classname) {
		if (array_key_exists($classname, self::$providers)) {
			return self::$providers[$classname];
		}
		
		$provider = new $classname;
		
		if (!($provider instanceof ServiceProviderInterface)) {
			throw new \InvalidArgumentException("$classname is not a valid ServiceProviderInterface instance");
		}

		self::$providers[$classname] = $provider;
		return self::$providers[$classname];
	}
598022
public function getHostname()
    {
        if ($this->hostname === null) {
            $hostname = @gethostbyaddr($this->hostAddress);
            if ($hostname === false) {
                $hostname = $this->hostAddress;
            }
            $this->hostname = $hostname;
        }

        return $this->hostname;
    }
1188452
public static function getHostByName($name) {
        if (!is_string($name)) throw new IllegalTypeException('Illegal type of parameter $name: '.gettype($name));
        if ($name == '')       throw new InvalidArgumentException('Invalid argument $name: "'.$name.'"');

        return \gethostbyname($name);
    }
451074
public function getResource($resourceName)
    {
        if (!isset($this->resources[$resourceName])) {
            throw new \InvalidArgumentException(
                \sprintf('Resource "%s" not found', $resourceName)
            );
        }

        return $this->resources[$resourceName];
    }
1309794
public function host()
    {
        if (Validation::ip($this->_config['host'])) {
            return gethostbyaddr($this->_config['host']);
        }

        return gethostbyaddr($this->address());
    }
318751
public final function withHost($host): UriInterface
   {
       if (!is_string($host) || !($parsedHost = $this->parseHost($host))) {
           throw new InvalidArgumentException(
               "Can't get with host: invalid host name");
       }
       return $this->with("host", $parsedHost);
   }
1339323
public static function parse(string $hostname): HostnameInterface
    {
        if (!self::myParse($hostname, $domainParts, $tld, $error)) {
            throw new HostnameInvalidArgumentException($error);
        }

        return new self($domainParts, $tld);
    }
1296055
public static function host(): ?string
    {
        $ip = self::ip();

        if (isset(static::$hosts[$ip])) {
            return static::$hosts[$ip];
        }

        $host = gethostbyaddr($ip);
        static::$hosts[$ip] = ($host === '') ? null : $host;
        return static::$hosts[$ip];
    }
1351858
public function make($driverName)
    {
        $driverName = trim(strtolower($driverName));
        switch ($driverName) {
            case 'google':
                return $this->google;
            case 'bitly':
                return $this->bitly;
            default:
                throw new InvalidArgumentException('Invalid URL Shortener driver name');
        }
    }
300088
protected function resolveHostname($hostname)
    {
        if (false !== filter_var($hostname, FILTER_VALIDATE_IP)) {
            return \React\Promise\resolve($hostname);
        }

        return $this->getResolver()->resolve($hostname);
    }
1271116
public function getHostname(): HostnameInterface
    {
        if ($this->myHostname !== null) {
            return $this->myHostname;
        }

        // If no hostname is present, create a standard "in-addr.arpa" hostname from IP address.
        $ipAddressParts = $this->myIpAddress->getParts();

        return Hostname::fromParts([
            strval($ipAddressParts[3]),
            strval($ipAddressParts[2]),
            strval($ipAddressParts[1]),
            strval($ipAddressParts[0]),
            'in-addr',
        ], 'arpa');
    }
336952
public static function hostname()
    {
        $hostName = null;
        $forwardedHostsString = self::serverVariable( 'HTTP_X_FORWARDED_HOST', true );
        if ( $forwardedHostsString )
        {
            $forwardedHosts = explode( ',', $forwardedHostsString );
            $hostName = trim( $forwardedHosts[0] );
        }

        if ( !$hostName && self::serverVariable( 'HTTP_HOST', true ) )
        {
            $hostName = self::serverVariable( 'HTTP_HOST' );
        }

        if ( !$hostName )
        {
            $siteUrl = eZINI::instance()->variable( 'SiteSettings', 'SiteURL' );
            $hostName = parse_url( "http://{$siteUrl}", PHP_URL_HOST );
        }

        return $hostName;
    }
993953
private function decodeHost($hostname)
    {
        if (preg_match('/^[\\x00-\\x7F]*$/', $hostname)) {
            return $hostname;
        } elseif ($this->mode !== self::MODE_IDNA2003) {
            throw new \InvalidArgumentException("Invalid hostname '$hostname'");
        }

        $hostname = idn_to_ascii($hostname);

        if ($hostname === false) {
            throw new \InvalidArgumentException("Invalid hostname '$hostname'");
        }

        return $hostname;
    }
155302
public function getVHostConfigAdv($serverName, $vhostName)
    {
        list($response) = $this->getVHostConfigAdvWithHttpInfo($serverName, $vhostName);
        return $response;
    }
779901
public function getConfiguration($connectionName = 'default')
    {
        if (!$this->configurations->containsKey($connectionName)) {
            throw new \InvalidArgumentException(sprintf('Any registered configuration under given key.'));
        }

        return $this->configurations->get($connectionName);
    }