本文整理匯總了PHP中google\protobuf\FieldDescriptorProto\Label::value方法的典型用法代碼示例。如果您正苦於以下問題:PHP Label::value方法的具體用法?PHP Label::value怎麽用?PHP Label::value使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類google\protobuf\FieldDescriptorProto\Label
的用法示例。
在下文中一共展示了Label::value方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: serializedSize
/**
* {@inheritdoc}
*/
public function serializedSize(\Protobuf\ComputeSizeContext $context)
{
$calculator = $context->getSizeCalculator();
$size = 0;
if ($this->name !== null) {
$size += 1;
$size += $calculator->computeStringSize($this->name);
}
if ($this->number !== null) {
$size += 1;
$size += $calculator->computeVarintSize($this->number);
}
if ($this->label !== null) {
$size += 1;
$size += $calculator->computeVarintSize($this->label->value());
}
if ($this->type !== null) {
$size += 1;
$size += $calculator->computeVarintSize($this->type->value());
}
if ($this->type_name !== null) {
$size += 1;
$size += $calculator->computeStringSize($this->type_name);
}
if ($this->extendee !== null) {
$size += 1;
$size += $calculator->computeStringSize($this->extendee);
}
if ($this->default_value !== null) {
$size += 1;
$size += $calculator->computeStringSize($this->default_value);
}
if ($this->oneof_index !== null) {
$size += 1;
$size += $calculator->computeVarintSize($this->oneof_index);
}
if ($this->json_name !== null) {
$size += 1;
$size += $calculator->computeStringSize($this->json_name);
}
if ($this->options !== null) {
$innerSize = $this->options->serializedSize($context);
$size += 1;
$size += $innerSize;
$size += $calculator->computeVarintSize($innerSize);
}
if ($this->extensions !== null) {
$size += $this->extensions->serializedSize($context);
}
return $size;
}