original_string: protected function assertRemainingPacketLength($value = null, $fromPacket = true)
      {
          if ($value === null && $this->remainingPacketLength === 0) {
              $this->throwException('Expected payload but remaining packet length is zero.', $fromPacket);
          }
  
          if ($value !== null && $this->remainingPacketLength !== $value) {
              $this->throwException(
                  sprintf(
                      'Expected remaining packet length of %d bytes but got %d.',
                      $value,
                      $this->remainingPacketLength
                  ),
                  $fromPacket
              );
          }
      }
code: protected function assertRemainingPacketLength($value = null, $fromPacket = true)
      {
          if ($value === null && $this->remainingPacketLength === 0) {
              $this->throwException('Expected payload but remaining packet length is zero.', $fromPacket);
          }
  
          if ($value !== null && $this->remainingPacketLength !== $value) {
              $this->throwException(
                  sprintf(
                      'Expected remaining packet length of %d bytes but got %d.',
                      $value,
                      $this->remainingPacketLength
                  ),
                  $fromPacket
              );
          }
      }
code_tokens: protected function assertRemainingPacketLength ( $ value = null , $ fromPacket = true ) { if ( $ value === null && $ this -> remainingPacketLength === 0 ) { $ this -> throwException ( 'Expected payload but remaining packet length is zero.' , $ fromPacket ) ; } if ( $ value !== null && $ this -> remainingPacketLength !== $ value ) { $ this -> throwException ( sprintf ( 'Expected remaining packet length of %d bytes but got %d.' , $ value , $ this -> remainingPacketLength ) , $ fromPacket ) ; } }
docstring: Asserts that the remaining length is greater than zero and has a specific value.
  
  @param int|null $value      value to test or null if any value greater than zero is valid
  @param bool     $fromPacket
  
  @throws MalformedPacketException
  @throws \InvalidArgumentException
docstring_tokens: Asserts that the remaining length is greater than zero and has a specific value .