src/Common/Endpoint/Uri.php
private function filterPort($scheme, $host, $port)
    {
        if (null !== $port) {
            $port = (int) $port;
            if (1 > $port || 65535 < $port) {
                throw new \InvalidArgumentException(sprintf('Invalid port: %d. Must be between 1 and 65535', $port));
            }
        }

        return self::isStandardPort($port, (string) $scheme, (string) $host) ? null : $port;
    }
private function filterPort($scheme, $host, $port)
    {
        if (null !== $port) {
            $port = (int) $port;
            if (1 > $port || 65535 < $port) {
                throw new \InvalidArgumentException(sprintf('Invalid port: %d. Must be between 1 and 65535', $port));
            }
        }

        return self::isStandardPort($port, (string) $scheme, (string) $host) ? null : $port;
    }
private function filterPort ( $ scheme , $ host , $ port ) { if ( null !== $ port ) { $ port = ( int ) $ port ; if ( 1 > $ port || 65535 < $ port ) { throw new \ InvalidArgumentException ( sprintf ( 'Invalid port: %d. Must be between 1 and 65535' , $ port ) ) ; } } return self :: isStandardPort ( $ port , ( string ) $ scheme , ( string ) $ host ) ? null : $ port ; }
Filter port before setting it.

@param string $scheme
@param string $host
@param int    $port

@return int|null

@throws \InvalidArgumentException if the port is invalid.
Filter port before setting it .