src/Koldy/Url.php
public function getPort(): int
    {
        if (!isset($this->segments['port'])) {
            throw new UrlException('Unable to get port for ' . $this->url);
        }

        return (int)$this->segments['port'];
    }
public function getPort(): int
    {
        if (!isset($this->segments['port'])) {
            throw new UrlException('Unable to get port for ' . $this->url);
        }

        return (int)$this->segments['port'];
    }
public function getPort ( ) : int { if ( ! isset ( $ this -> segments [ 'port' ] ) ) { throw new UrlException ( 'Unable to get port for ' . $ this -> url ) ; } return ( int ) $ this -> segments [ 'port' ] ; }
Get URL's port

@return int
@throws \Koldy\Url\Exception
Get URL s port