protected function validatePort(int $port = null): void
    {
        if ($port !== null && ($port < 1 || $port > 65535)) {
            throw new InvalidPort(
                sprintf(
                    'Invalid port "%d" specified; must be a valid TCP/UDP port',
                    $port
                )
            );
        }
    }
protected function validatePort(int $port = null): void
    {
        if ($port !== null && ($port < 1 || $port > 65535)) {
            throw new InvalidPort(
                sprintf(
                    'Invalid port "%d" specified; must be a valid TCP/UDP port',
                    $port
                )
            );
        }
    }
protected function validatePort ( int $ port = null ) : void { if ( $ port !== null && ( $ port < 1 || $ port > 65535 ) ) { throw new InvalidPort ( sprintf ( 'Invalid port "%d" specified; must be a valid TCP/UDP port' , $ port ) ) ; } }
Validate a port.

@param int $port The port

@throws \Valkyrja\HttpMessage\Exceptions\InvalidPort

@return void
Validate a port .