Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. Message.php

function Message::skipField

@ignore

1 call to Message::skipField()
Message::parseFieldFromStream in vendor/google/protobuf/src/Google/Protobuf/Internal/Message.php
@ignore

File

vendor/google/protobuf/src/Google/Protobuf/Internal/Message.php, line 287

Class

Message
Parent class of all proto messages. Users should not instantiate this class or extend this class or its child classes by their own. See the comment of specific functions for more details.

Namespace

Google\Protobuf\Internal

Code

private function skipField($input, $tag) {
    $number = GPBWire::getTagFieldNumber($tag);
    if ($number === 0) {
        throw new GPBDecodeException("Illegal field number zero.");
    }
    $start = $input->current();
    switch (GPBWire::getTagWireType($tag)) {
        case GPBWireType::VARINT:
            $uint64 = 0;
            if (!$input->readVarint64($uint64)) {
                throw new GPBDecodeException("Unexpected EOF inside varint.");
            }
            break;
        case GPBWireType::FIXED64:
            $uint64 = 0;
            if (!$input->readLittleEndian64($uint64)) {
                throw new GPBDecodeException("Unexpected EOF inside fixed64.");
            }
            break;
        case GPBWireType::FIXED32:
            $uint32 = 0;
            if (!$input->readLittleEndian32($uint32)) {
                throw new GPBDecodeException("Unexpected EOF inside fixed32.");
            }
            break;
        case GPBWireType::LENGTH_DELIMITED:
            $length = 0;
            if (!$input->readVarint32($length)) {
                throw new GPBDecodeException("Unexpected EOF inside length.");
            }
            $data = NULL;
            if (!$input->readRaw($length, $data)) {
                throw new GPBDecodeException("Unexpected EOF inside length delimited data.");
            }
            break;
        case GPBWireType::START_GROUP:
        case GPBWireType::END_GROUP:
            throw new GPBDecodeException("Unexpected wire type.");
        default:
            throw new GPBDecodeException("Unexpected wire type.");
    }
    $end = $input->current();
    $bytes = str_repeat(chr(0), CodedOutputStream::MAX_VARINT64_BYTES);
    $size = CodedOutputStream::writeVarintToArray($tag, $bytes, true);
    $this->unknown .= substr($bytes, 0, $size) . $input->substr($start, $end);
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal