Ergo\Http\Url::getDefaultPort PHP Method

getDefaultPort() public method

The default TCP port for the scheme of the URL
public getDefaultPort ( ) : integer
return integer or null
    public function getDefaultPort()
    {
        if (!$this->hasDefaultPort()) {
            throw new UrlException(sprintf("No default port for URL '%s'", $this->_inputString));
        }
        $scheme = $this->getScheme();
        if ($scheme == 'http') {
            return 80;
        } elseif ($scheme == 'https') {
            return 443;
        } else {
            throw new UrlException("No default port for scheme '{$scheme}'");
        }
    }