/** * Returns whether the standard port for the given scheme is used, when * the scheme is unknown or unsupported will the method return false * * @return bool */ protected function hasStandardPort() { $port = $this->port->toInt(); if (empty($port)) { return true; } $scheme = $this->scheme->__toString(); if (empty($scheme)) { return false; } return isset(static::$supportedSchemes[$scheme]) && static::$supportedSchemes[$scheme] === $port; }