protected function assertValidQosLevel($level, $fromPacket = true)
    {
        if ($level < 0 || $level > 2) {
            $this->throwException(
                sprintf(
                    'Expected a quality of service level between 0 and 2 but got %d.',
                    $level
                ),
                $fromPacket
            );
        }
    }
protected function assertValidQosLevel($level, $fromPacket = true)
    {
        if ($level < 0 || $level > 2) {
            $this->throwException(
                sprintf(
                    'Expected a quality of service level between 0 and 2 but got %d.',
                    $level
                ),
                $fromPacket
            );
        }
    }
protected function assertValidQosLevel ( $ level , $ fromPacket = true ) { if ( $ level < 0 || $ level > 2 ) { $ this -> throwException ( sprintf ( 'Expected a quality of service level between 0 and 2 but got %d.' , $ level ) , $ fromPacket ) ; } }
Asserts that the given quality of service level is valid.

@param int  $level
@param bool $fromPacket

@throws MalformedPacketException
@throws \InvalidArgumentException
Asserts that the given quality of service level is valid .