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
            );
        }
    }
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
            );
        }
    }
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 ) ; } }
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
Asserts that the remaining length is greater than zero and has a specific value .