public function skip()

in thrift/lib/hack/src/protocol/TProtocol.php [227:315]


  public function skip($type) {
    $_ref = null;
    switch ($type) {
      case TType::BOOL:
        return $this->readBool($_ref);
      case TType::BYTE:
        return $this->readByte($_ref);
      case TType::I16:
        return $this->readI16($_ref);
      case TType::I32:
        return $this->readI32($_ref);
      case TType::I64:
        return $this->readI64($_ref);
      case TType::DOUBLE:
        return $this->readDouble($_ref);
      case TType::FLOAT:
        return $this->readFloat($_ref);
      case TType::STRING:
        return $this->readString($_ref);
      case TType::STRUCT: {
          $result = $this->readStructBegin(inout $_ref);
          while (true) {
            $ftype = null;
            $result += $this->readFieldBegin(
              inout $_ref,
              inout $ftype,
              inout $_ref,
            );
            if ($ftype == TType::STOP) {
              break;
            }
            $result += $this->skip($ftype);
            $result += $this->readFieldEnd();
          }
          $result += $this->readStructEnd();
          return $result;
        }
      case TType::MAP: {
          $keyType = null;
          $valType = null;
          $size = 0;
          $result = $this->readMapBegin(
            inout $keyType,
            inout $valType,
            inout $size,
          );
          for ($i = 0; $size === null || $i < $size; $i++) {
            if ($size === null && !$this->readMapHasNext()) {
              break;
            }
            $result += $this->skip($keyType);
            $result += $this->skip($valType);
          }
          $result += $this->readMapEnd();
          return $result;
        }
      case TType::SET: {
          $elemType = null;
          $size = 0;
          $result = $this->readSetBegin($elemType, $size);
          for ($i = 0; $size === null || $i < $size; $i++) {
            if ($size === null && !$this->readSetHasNext()) {
              break;
            }
            $result += $this->skip($elemType);
          }
          $result += $this->readSetEnd();
          return $result;
        }
      case TType::LST: {
          $elemType = null;
          $size = 0;
          $result = $this->readListBegin($elemType, $size);
          for ($i = 0; $size === null || $i < $size; $i++) {
            if ($size === null && !$this->readSetHasNext()) {
              break;
            }
            $result += $this->skip($elemType);
          }
          $result += $this->readListEnd();
          return $result;
        }
      default:
        throw new TProtocolException(
          'Unknown field type: '.$type,
          TProtocolException::INVALID_DATA,
        );
    }
  }