/** * {@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->input_type !== null) { $size += 1; $size += $calculator->computeStringSize($this->input_type); } if ($this->output_type !== null) { $size += 1; $size += $calculator->computeStringSize($this->output_type); } if ($this->options !== null) { $innerSize = $this->options->serializedSize($context); $size += 1; $size += $innerSize; $size += $calculator->computeVarintSize($innerSize); } if ($this->client_streaming !== null) { $size += 1; $size += 1; } if ($this->server_streaming !== null) { $size += 1; $size += 1; } if ($this->extensions !== null) { $size += $this->extensions->serializedSize($context); } return $size; }
<?php // DO NOT EDIT! Generated by Protobuf-PHP protoc plugin 1.0 // Source: google/api/annotations.proto // Date: 2016-03-02 22:35:01 namespace { \google\protobuf\MethodOptions::extension(function () { // OPTIONAL MESSAGE google\api\http = 72295728 $f = new \DrSlump\Protobuf\Field(); $f->number = 72295728; $f->name = "google\\api\\http"; $f->type = \DrSlump\Protobuf::TYPE_MESSAGE; $f->rule = \DrSlump\Protobuf::RULE_OPTIONAL; $f->reference = '\\google\\api\\HttpRule'; return $f; }); }