original_string: 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
              );
          }
      }
code: 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
              );
          }
      }
code_tokens: 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 ) ; } }
docstring: Asserts that the given quality of service level is valid.
  
  @param int  $level
  @param bool $fromPacket
  
  @throws MalformedPacketException
  @throws \InvalidArgumentException
docstring_tokens: Asserts that the given quality of service level is valid .