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

Method writeBool

lib/php/lib/Protocol/TCompactProtocol.php:312–326  ·  view source on GitHub ↗
($value)

Source from the content-addressed store, hash-verified

310 }
311
312 public function writeBool($value)
313 {
314 if ($this->state == TCompactProtocol::STATE_BOOL_WRITE) {
315 $ctype = TCompactProtocol::COMPACT_FALSE;
316 if ($value) {
317 $ctype = TCompactProtocol::COMPACT_TRUE;
318 }
319
320 return $this->writeFieldHeader($ctype, $this->boolFid);
321 } elseif ($this->state == TCompactProtocol::STATE_CONTAINER_WRITE) {
322 return $this->writeByte($value ? 1 : 0);
323 } else {
324 throw new TProtocolException('Invalid state in compact protocol');
325 }
326 }
327
328 public function writeByte($value)
329 {

Callers

nothing calls this directly

Calls 2

writeFieldHeaderMethod · 0.95
writeByteMethod · 0.95

Tested by

no test coverage detected