src/Control/Director.php
public static function port(HTTPRequest $request = null)
    {
        $host = static::host($request);
        return (int)parse_url($host, PHP_URL_PORT) ?: null;
    }
public static function port(HTTPRequest $request = null)
    {
        $host = static::host($request);
        return (int)parse_url($host, PHP_URL_PORT) ?: null;
    }
public static function port ( HTTPRequest $ request = null ) { $ host = static :: host ( $ request ) ; return ( int ) parse_url ( $ host , PHP_URL_PORT ) ? : null ; }
Return port used for the base URL.
Note, this will be null if not specified, in which case you should assume the default
port for the current protocol.

@param HTTPRequest $request
@return int|null
Return port used for the base URL . Note this will be null if not specified in which case you should assume the default port for the current protocol .