private function assertValidReturnCode($returnCode, $fromPacket = true)
    {
        if (!in_array($returnCode, [0, 1, 2, 128])) {
            $this->throwException(
                sprintf('Malformed return code %02x.', $returnCode),
                $fromPacket
            );
        }
    }
private function assertValidReturnCode($returnCode, $fromPacket = true)
    {
        if (!in_array($returnCode, [0, 1, 2, 128])) {
            $this->throwException(
                sprintf('Malformed return code %02x.', $returnCode),
                $fromPacket
            );
        }
    }
private function assertValidReturnCode ( $ returnCode , $ fromPacket = true ) { if ( ! in_array ( $ returnCode , [ 0 , 1 , 2 , 128 ] ) ) { $ this -> throwException ( sprintf ( 'Malformed return code %02x.' , $ returnCode ) , $ fromPacket ) ; } }
Asserts that a return code is valid.

@param int  $returnCode
@param bool $fromPacket

@throws MalformedPacketException
@throws \InvalidArgumentException
Asserts that a return code is valid .