ポートがスキームのデフォルトポートか判定する

@param   string  $scheme
スキーム文字列
@param   int $port
ポート番号

@return  bool
509158
public static function isDefaultPort(string $scheme, int $port){
        $scheme = strtolower($scheme);

        return
            array_key_exists($scheme, static::DEFAULT_PORT)
            && static::DEFAULT_PORT[$scheme] === $port
        ;
    }
226859
private final static int defaultPort(String scheme) {
        if (scheme == null) {
            return -1;
        }
        Integer port = defaultPorts.get(scheme.trim().toLowerCase());
        return (port != null) ? port.intValue() : -1;
    }
1047376
public function withPort($port): URI
    {
        $result = clone $this;
        $result->port = $this->filterPort($port);

        return $result;
    }
265369
protected function check_port($port = 8000, $host = '127.0.0.1', $timeout = 3)
    {
        $fp = @fsockopen($host, $port, $errno, $errstr, $timeout);
        if (!$fp) {
            return true;
        } else {
            fclose($fp);

            return false;
        }
    }
346227
protected static function toggleSerializeScheme(array $scheme)
    {
        foreach ($scheme as $name => &$options) {
            if (is_array($options)) {
                foreach (ParasiticAgent::methods() as $method) {
                    self::toggleSerializeClosure($options, $method);
                }
            }
        }

        return $scheme;
    }
344973
public function port(int $defaultPort = null): int
    {

        if ($this->isHttp()) {
            return parent::port(Http::PORT);
        }

        return parent::port(Http::PORT_SSL);
    }
743124
private static function isAllowedScheme($scheme)
    {
        if (preg_match(AbstractRequest::HTTP, $scheme) === 1) {
            return 'http';
        } elseif (preg_match(AbstractRequest::FTP, $scheme) === 1) {
            return 'ftp';
        } elseif (preg_match(AbstractRequest::SSH, $scheme) === 1) {
            return 'ssh';
        } else {
            return false;
        }
    }
99933
public function withPort($port)
    {
        if ($port === null) {
            return $this->_clone('port', null);
        }

        if ($port < 1 || $port > 65535) {
            throw new InvalidArgumentException('Invalid port specified');
        }

        return $this->_clone('port', (int)$port);
    }
857288
public function setScheme( ?string $scheme = null ) : Url
   {

      if ( null === $scheme || ! \preg_match( '~^[a-z]{3,7}$~i', $scheme ) )
      {
         $this->scheme = 'http';
         return $this;
      }

      $this->scheme = $scheme;

      return $this;

   }
653003
public function set_port($port)
	{
		if ($port === null)
		{
			$this->port = null;
			return true;
		}
		elseif (strspn($port, '0123456789') === strlen($port))
		{
			$this->port = (int) $port;
			$this->scheme_normalization();
			return true;
		}
		else
		{
			$this->port = null;
			return false;
		}
	}
31355
public function setScheme($scheme)
    {
        $this->scheme = strtolower((string) $scheme);

        $this->ssl = ($this->scheme === 'https');

        return $this;
    }
134896
public function withPort($port): UriInterface
    {
        $port = $this->filterPort($port);

        $clone = clone $this;
        $clone->port = $port;

        return $clone;
    }
519801
protected function _hasServer($host, $port)
    {
        $servers = $this->getServerList();
        foreach ($servers as $server) {
            if ($server['host'] === $host && $server['port'] === $port) {
                return true;
            }
        }

        return false;
    }
743787
protected function filterPort($port)
    {
        if (empty($port)) {
            return null;
        }

        if (!self::validePort($port)) {
            throw new \InvalidArgumentException('The port is not in the TCP/UDP port.');
        }

        return $this->scheme !== '' && !$this->validPortStandard($port)
            ? (int) $port
            : null;
    }
1031440
public static function is_port_open($host, $port)
	{
		$connection = @fsockopen($host, $port);
		if (is_resource($connection))
		{
			fclose($connection);
			return FALSE;
		}
		return TRUE;
	}
391785
static void setHost(String scheme, String host, int port) {
    BASE_URL = scheme + "://" + host + ":" + port + "/" + VERSION + "/";
  }
632169
public function setPort($port)
        {
            if ($this->validatePort($port) === false) {
                throw new Exception("Port \"$port\" is not a valid HTTP port.");
            }

            $oldPort     = $this->_port;
            $this->_port = $port;

            return $oldPort;
        }