MCPcopy Create free account
hub / github.com/apache/thrift / skip

Method skip

lib/php/lib/Protocol/TProtocol.php:190–257  ·  view source on GitHub ↗

* The skip function is a utility to parse over unrecognized date without * causing corruption. * * @param int $type What type is it (defined in TType::class) */

($type)

Source from the content-addressed store, hash-verified

188 * @param int $type What type is it (defined in TType::class)
189 */
190 public function skip($type)
191 {
192 switch ($type) {
193 case TType::BOOL:
194 return $this->readBool($bool);
195 case TType::BYTE:
196 return $this->readByte($byte);
197 case TType::I16:
198 return $this->readI16($i16);
199 case TType::I32:
200 return $this->readI32($i32);
201 case TType::I64:
202 return $this->readI64($i64);
203 case TType::DOUBLE:
204 return $this->readDouble($dub);
205 case TType::STRING:
206 return $this->readString($str);
207 case TType::UUID:
208 return $this->readUuid($uuid);
209 case TType::STRUCT:
210 $result = $this->readStructBegin($name);
211 while (true) {
212 $result += $this->readFieldBegin($name, $ftype, $fid);
213 if ($ftype == TType::STOP) {
214 break;
215 }
216 $result += $this->skip($ftype);
217 $result += $this->readFieldEnd();
218 }
219 $result += $this->readStructEnd();
220
221 return $result;
222
223 case TType::MAP:
224 $result = $this->readMapBegin($keyType, $valType, $size);
225 for ($i = 0; $i < $size; $i++) {
226 $result += $this->skip($keyType);
227 $result += $this->skip($valType);
228 }
229 $result += $this->readMapEnd();
230
231 return $result;
232
233 case TType::SET:
234 $result = $this->readSetBegin($elemType, $size);
235 for ($i = 0; $i < $size; $i++) {
236 $result += $this->skip($elemType);
237 }
238 $result += $this->readSetEnd();
239
240 return $result;
241
242 case TType::LST:
243 $result = $this->readListBegin($elemType, $size);
244 for ($i = 0; $i < $size; $i++) {
245 $result += $this->skip($elemType);
246 }
247 $result += $this->readListEnd();

Callers 9

mainFunction · 0.45
_readMethod · 0.45
_readMethod · 0.45
thrift.jsFile · 0.45
binary_protocol.jsFile · 0.45
json_protocol.jsFile · 0.45
header_protocol.jsFile · 0.45
recv_testI32Function · 0.45

Calls 15

readBoolMethod · 0.95
readByteMethod · 0.95
readI16Method · 0.95
readI32Method · 0.95
readI64Method · 0.95
readDoubleMethod · 0.95
readStringMethod · 0.95
readUuidMethod · 0.95
readStructBeginMethod · 0.95
readFieldBeginMethod · 0.95
readFieldEndMethod · 0.95
readStructEndMethod · 0.95

Tested by 1

recv_testI32Function · 0.36