update lock clucknut
All checks were successful
All checks were successful
This commit is contained in:
4
vendor/google/protobuf/composer.json
vendored
4
vendor/google/protobuf/composer.json
vendored
@@ -6,10 +6,10 @@
|
||||
"homepage": "https://developers.google.com/protocol-buffers/",
|
||||
"license": "BSD-3-Clause",
|
||||
"require": {
|
||||
"php": ">=8.1.0"
|
||||
"php": ">=8.2.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpunit/phpunit": ">=5.0.0 <8.5.27"
|
||||
"phpunit/phpunit": ">=11.5.0 <12.0.0"
|
||||
},
|
||||
"suggest": {
|
||||
"ext-bcmath": "Need to support JSON deserialization"
|
||||
|
||||
@@ -229,6 +229,7 @@ public static function initOnce() {
|
||||
->optional('edition_deprecated', \Google\Protobuf\Internal\GPBType::ENUM, 2, 'google.protobuf.internal.Edition')
|
||||
->optional('deprecation_warning', \Google\Protobuf\Internal\GPBType::STRING, 3)
|
||||
->optional('edition_removed', \Google\Protobuf\Internal\GPBType::ENUM, 4, 'google.protobuf.internal.Edition')
|
||||
->optional('removal_error', \Google\Protobuf\Internal\GPBType::STRING, 5)
|
||||
->finalizeToPool();
|
||||
|
||||
$pool->addEnum('google.protobuf.internal.FieldOptions.CType', \Google\Protobuf\Internal\CType::class)
|
||||
|
||||
@@ -225,9 +225,9 @@ public function getTypeUrl()
|
||||
* @param string $var
|
||||
* @return $this
|
||||
*/
|
||||
public function setTypeUrl($var)
|
||||
public function setTypeUrl(string $var)
|
||||
{
|
||||
GPBUtil::checkString($var, True);
|
||||
GPBUtil::checkString($var, true);
|
||||
$this->type_url = $var;
|
||||
|
||||
return $this;
|
||||
@@ -251,9 +251,9 @@ public function getValue()
|
||||
* @param string $var
|
||||
* @return $this
|
||||
*/
|
||||
public function setValue($var)
|
||||
public function setValue(string $var)
|
||||
{
|
||||
GPBUtil::checkString($var, False);
|
||||
GPBUtil::checkString($var, false);
|
||||
$this->value = $var;
|
||||
|
||||
return $this;
|
||||
|
||||
@@ -161,9 +161,9 @@ public function getName()
|
||||
* @param string $var
|
||||
* @return $this
|
||||
*/
|
||||
public function setName($var)
|
||||
public function setName(string $var)
|
||||
{
|
||||
GPBUtil::checkString($var, True);
|
||||
GPBUtil::checkString($var, true);
|
||||
$this->name = $var;
|
||||
|
||||
return $this;
|
||||
@@ -187,7 +187,7 @@ public function getMethods()
|
||||
* @param \Google\Protobuf\Method[] $var
|
||||
* @return $this
|
||||
*/
|
||||
public function setMethods($var)
|
||||
public function setMethods(array|RepeatedField $var)
|
||||
{
|
||||
$arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Method::class);
|
||||
$this->methods = $arr;
|
||||
@@ -213,7 +213,7 @@ public function getOptions()
|
||||
* @param \Google\Protobuf\Option[] $var
|
||||
* @return $this
|
||||
*/
|
||||
public function setOptions($var)
|
||||
public function setOptions(array|RepeatedField $var)
|
||||
{
|
||||
$arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Option::class);
|
||||
$this->options = $arr;
|
||||
@@ -271,9 +271,9 @@ public function getVersion()
|
||||
* @param string $var
|
||||
* @return $this
|
||||
*/
|
||||
public function setVersion($var)
|
||||
public function setVersion(string $var)
|
||||
{
|
||||
GPBUtil::checkString($var, True);
|
||||
GPBUtil::checkString($var, true);
|
||||
$this->version = $var;
|
||||
|
||||
return $this;
|
||||
@@ -309,9 +309,8 @@ public function clearSourceContext()
|
||||
* @param \Google\Protobuf\SourceContext $var
|
||||
* @return $this
|
||||
*/
|
||||
public function setSourceContext($var)
|
||||
public function setSourceContext(\Google\Protobuf\SourceContext|null $var)
|
||||
{
|
||||
GPBUtil::checkMessage($var, \Google\Protobuf\SourceContext::class);
|
||||
$this->source_context = $var;
|
||||
|
||||
return $this;
|
||||
@@ -335,7 +334,7 @@ public function getMixins()
|
||||
* @param \Google\Protobuf\Mixin[] $var
|
||||
* @return $this
|
||||
*/
|
||||
public function setMixins($var)
|
||||
public function setMixins(array|RepeatedField $var)
|
||||
{
|
||||
$arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Mixin::class);
|
||||
$this->mixins = $arr;
|
||||
@@ -347,7 +346,7 @@ public function setMixins($var)
|
||||
* The source syntax of the service.
|
||||
*
|
||||
* Generated from protobuf field <code>.google.protobuf.Syntax syntax = 7;</code>
|
||||
* @return int
|
||||
* @return int one of the values in {@see \Google\Protobuf\Syntax}
|
||||
*/
|
||||
public function getSyntax()
|
||||
{
|
||||
@@ -358,10 +357,10 @@ public function getSyntax()
|
||||
* The source syntax of the service.
|
||||
*
|
||||
* Generated from protobuf field <code>.google.protobuf.Syntax syntax = 7;</code>
|
||||
* @param int $var
|
||||
* @param int $var one of the values in {@see \Google\Protobuf\Syntax}
|
||||
* @return $this
|
||||
*/
|
||||
public function setSyntax($var)
|
||||
public function setSyntax(int $var)
|
||||
{
|
||||
GPBUtil::checkEnum($var, \Google\Protobuf\Syntax::class);
|
||||
$this->syntax = $var;
|
||||
@@ -387,9 +386,9 @@ public function getEdition()
|
||||
* @param string $var
|
||||
* @return $this
|
||||
*/
|
||||
public function setEdition($var)
|
||||
public function setEdition(string $var)
|
||||
{
|
||||
GPBUtil::checkString($var, True);
|
||||
GPBUtil::checkString($var, true);
|
||||
$this->edition = $var;
|
||||
|
||||
return $this;
|
||||
|
||||
@@ -59,9 +59,8 @@ public function getValue()
|
||||
* @param bool $var
|
||||
* @return $this
|
||||
*/
|
||||
public function setValue($var)
|
||||
public function setValue(bool $var)
|
||||
{
|
||||
GPBUtil::checkBool($var);
|
||||
$this->value = $var;
|
||||
|
||||
return $this;
|
||||
|
||||
@@ -59,9 +59,9 @@ public function getValue()
|
||||
* @param string $var
|
||||
* @return $this
|
||||
*/
|
||||
public function setValue($var)
|
||||
public function setValue(string $var)
|
||||
{
|
||||
GPBUtil::checkString($var, False);
|
||||
GPBUtil::checkString($var, false);
|
||||
$this->value = $var;
|
||||
|
||||
return $this;
|
||||
|
||||
@@ -59,9 +59,8 @@ public function getValue()
|
||||
* @param float $var
|
||||
* @return $this
|
||||
*/
|
||||
public function setValue($var)
|
||||
public function setValue(float $var)
|
||||
{
|
||||
GPBUtil::checkDouble($var);
|
||||
$this->value = $var;
|
||||
|
||||
return $this;
|
||||
|
||||
@@ -126,7 +126,7 @@ public function getSeconds()
|
||||
* @param int|string $var
|
||||
* @return $this
|
||||
*/
|
||||
public function setSeconds($var)
|
||||
public function setSeconds(int|string $var)
|
||||
{
|
||||
GPBUtil::checkInt64($var);
|
||||
$this->seconds = $var;
|
||||
@@ -162,7 +162,7 @@ public function getNanos()
|
||||
* @param int $var
|
||||
* @return $this
|
||||
*/
|
||||
public function setNanos($var)
|
||||
public function setNanos(int $var)
|
||||
{
|
||||
GPBUtil::checkInt32($var);
|
||||
$this->nanos = $var;
|
||||
|
||||
@@ -100,9 +100,9 @@ public function getName()
|
||||
* @param string $var
|
||||
* @return $this
|
||||
*/
|
||||
public function setName($var)
|
||||
public function setName(string $var)
|
||||
{
|
||||
GPBUtil::checkString($var, True);
|
||||
GPBUtil::checkString($var, true);
|
||||
$this->name = $var;
|
||||
|
||||
return $this;
|
||||
@@ -126,7 +126,7 @@ public function getEnumvalue()
|
||||
* @param \Google\Protobuf\EnumValue[] $var
|
||||
* @return $this
|
||||
*/
|
||||
public function setEnumvalue($var)
|
||||
public function setEnumvalue(array|RepeatedField $var)
|
||||
{
|
||||
$arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\EnumValue::class);
|
||||
$this->enumvalue = $arr;
|
||||
@@ -152,7 +152,7 @@ public function getOptions()
|
||||
* @param \Google\Protobuf\Option[] $var
|
||||
* @return $this
|
||||
*/
|
||||
public function setOptions($var)
|
||||
public function setOptions(array|RepeatedField $var)
|
||||
{
|
||||
$arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Option::class);
|
||||
$this->options = $arr;
|
||||
@@ -188,9 +188,8 @@ public function clearSourceContext()
|
||||
* @param \Google\Protobuf\SourceContext $var
|
||||
* @return $this
|
||||
*/
|
||||
public function setSourceContext($var)
|
||||
public function setSourceContext(\Google\Protobuf\SourceContext|null $var)
|
||||
{
|
||||
GPBUtil::checkMessage($var, \Google\Protobuf\SourceContext::class);
|
||||
$this->source_context = $var;
|
||||
|
||||
return $this;
|
||||
@@ -200,7 +199,7 @@ public function setSourceContext($var)
|
||||
* The source syntax.
|
||||
*
|
||||
* Generated from protobuf field <code>.google.protobuf.Syntax syntax = 5;</code>
|
||||
* @return int
|
||||
* @return int one of the values in {@see \Google\Protobuf\Syntax}
|
||||
*/
|
||||
public function getSyntax()
|
||||
{
|
||||
@@ -211,10 +210,10 @@ public function getSyntax()
|
||||
* The source syntax.
|
||||
*
|
||||
* Generated from protobuf field <code>.google.protobuf.Syntax syntax = 5;</code>
|
||||
* @param int $var
|
||||
* @param int $var one of the values in {@see \Google\Protobuf\Syntax}
|
||||
* @return $this
|
||||
*/
|
||||
public function setSyntax($var)
|
||||
public function setSyntax(int $var)
|
||||
{
|
||||
GPBUtil::checkEnum($var, \Google\Protobuf\Syntax::class);
|
||||
$this->syntax = $var;
|
||||
@@ -240,9 +239,9 @@ public function getEdition()
|
||||
* @param string $var
|
||||
* @return $this
|
||||
*/
|
||||
public function setEdition($var)
|
||||
public function setEdition(string $var)
|
||||
{
|
||||
GPBUtil::checkString($var, True);
|
||||
GPBUtil::checkString($var, true);
|
||||
$this->edition = $var;
|
||||
|
||||
return $this;
|
||||
|
||||
@@ -76,9 +76,9 @@ public function getName()
|
||||
* @param string $var
|
||||
* @return $this
|
||||
*/
|
||||
public function setName($var)
|
||||
public function setName(string $var)
|
||||
{
|
||||
GPBUtil::checkString($var, True);
|
||||
GPBUtil::checkString($var, true);
|
||||
$this->name = $var;
|
||||
|
||||
return $this;
|
||||
@@ -102,7 +102,7 @@ public function getNumber()
|
||||
* @param int $var
|
||||
* @return $this
|
||||
*/
|
||||
public function setNumber($var)
|
||||
public function setNumber(int $var)
|
||||
{
|
||||
GPBUtil::checkInt32($var);
|
||||
$this->number = $var;
|
||||
@@ -128,7 +128,7 @@ public function getOptions()
|
||||
* @param \Google\Protobuf\Option[] $var
|
||||
* @return $this
|
||||
*/
|
||||
public function setOptions($var)
|
||||
public function setOptions(array|RepeatedField $var)
|
||||
{
|
||||
$arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Option::class);
|
||||
$this->options = $arr;
|
||||
|
||||
@@ -122,7 +122,7 @@ public function __construct($data = NULL) {
|
||||
* The field type.
|
||||
*
|
||||
* Generated from protobuf field <code>.google.protobuf.Field.Kind kind = 1;</code>
|
||||
* @return int
|
||||
* @return int one of the values in {@see \Google\Protobuf\Field\Kind}
|
||||
*/
|
||||
public function getKind()
|
||||
{
|
||||
@@ -133,10 +133,10 @@ public function getKind()
|
||||
* The field type.
|
||||
*
|
||||
* Generated from protobuf field <code>.google.protobuf.Field.Kind kind = 1;</code>
|
||||
* @param int $var
|
||||
* @param int $var one of the values in {@see \Google\Protobuf\Field\Kind}
|
||||
* @return $this
|
||||
*/
|
||||
public function setKind($var)
|
||||
public function setKind(int $var)
|
||||
{
|
||||
GPBUtil::checkEnum($var, \Google\Protobuf\Field\Kind::class);
|
||||
$this->kind = $var;
|
||||
@@ -148,7 +148,7 @@ public function setKind($var)
|
||||
* The field cardinality.
|
||||
*
|
||||
* Generated from protobuf field <code>.google.protobuf.Field.Cardinality cardinality = 2;</code>
|
||||
* @return int
|
||||
* @return int one of the values in {@see \Google\Protobuf\Field\Cardinality}
|
||||
*/
|
||||
public function getCardinality()
|
||||
{
|
||||
@@ -159,10 +159,10 @@ public function getCardinality()
|
||||
* The field cardinality.
|
||||
*
|
||||
* Generated from protobuf field <code>.google.protobuf.Field.Cardinality cardinality = 2;</code>
|
||||
* @param int $var
|
||||
* @param int $var one of the values in {@see \Google\Protobuf\Field\Cardinality}
|
||||
* @return $this
|
||||
*/
|
||||
public function setCardinality($var)
|
||||
public function setCardinality(int $var)
|
||||
{
|
||||
GPBUtil::checkEnum($var, \Google\Protobuf\Field\Cardinality::class);
|
||||
$this->cardinality = $var;
|
||||
@@ -188,7 +188,7 @@ public function getNumber()
|
||||
* @param int $var
|
||||
* @return $this
|
||||
*/
|
||||
public function setNumber($var)
|
||||
public function setNumber(int $var)
|
||||
{
|
||||
GPBUtil::checkInt32($var);
|
||||
$this->number = $var;
|
||||
@@ -214,9 +214,9 @@ public function getName()
|
||||
* @param string $var
|
||||
* @return $this
|
||||
*/
|
||||
public function setName($var)
|
||||
public function setName(string $var)
|
||||
{
|
||||
GPBUtil::checkString($var, True);
|
||||
GPBUtil::checkString($var, true);
|
||||
$this->name = $var;
|
||||
|
||||
return $this;
|
||||
@@ -242,9 +242,9 @@ public function getTypeUrl()
|
||||
* @param string $var
|
||||
* @return $this
|
||||
*/
|
||||
public function setTypeUrl($var)
|
||||
public function setTypeUrl(string $var)
|
||||
{
|
||||
GPBUtil::checkString($var, True);
|
||||
GPBUtil::checkString($var, true);
|
||||
$this->type_url = $var;
|
||||
|
||||
return $this;
|
||||
@@ -270,7 +270,7 @@ public function getOneofIndex()
|
||||
* @param int $var
|
||||
* @return $this
|
||||
*/
|
||||
public function setOneofIndex($var)
|
||||
public function setOneofIndex(int $var)
|
||||
{
|
||||
GPBUtil::checkInt32($var);
|
||||
$this->oneof_index = $var;
|
||||
@@ -296,9 +296,8 @@ public function getPacked()
|
||||
* @param bool $var
|
||||
* @return $this
|
||||
*/
|
||||
public function setPacked($var)
|
||||
public function setPacked(bool $var)
|
||||
{
|
||||
GPBUtil::checkBool($var);
|
||||
$this->packed = $var;
|
||||
|
||||
return $this;
|
||||
@@ -322,7 +321,7 @@ public function getOptions()
|
||||
* @param \Google\Protobuf\Option[] $var
|
||||
* @return $this
|
||||
*/
|
||||
public function setOptions($var)
|
||||
public function setOptions(array|RepeatedField $var)
|
||||
{
|
||||
$arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Option::class);
|
||||
$this->options = $arr;
|
||||
@@ -348,9 +347,9 @@ public function getJsonName()
|
||||
* @param string $var
|
||||
* @return $this
|
||||
*/
|
||||
public function setJsonName($var)
|
||||
public function setJsonName(string $var)
|
||||
{
|
||||
GPBUtil::checkString($var, True);
|
||||
GPBUtil::checkString($var, true);
|
||||
$this->json_name = $var;
|
||||
|
||||
return $this;
|
||||
@@ -374,9 +373,9 @@ public function getDefaultValue()
|
||||
* @param string $var
|
||||
* @return $this
|
||||
*/
|
||||
public function setDefaultValue($var)
|
||||
public function setDefaultValue(string $var)
|
||||
{
|
||||
GPBUtil::checkString($var, True);
|
||||
GPBUtil::checkString($var, true);
|
||||
$this->default_value = $var;
|
||||
|
||||
return $this;
|
||||
|
||||
@@ -43,16 +43,6 @@ public function getNumber()
|
||||
return $this->internal_desc->getNumber();
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated Use isRepeated() or isRequired() instead.
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getLabel()
|
||||
{
|
||||
return $this->internal_desc->getLabel();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return boolean
|
||||
*/
|
||||
@@ -96,11 +86,20 @@ public function getRealContainingOneof()
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if this field tracks presence, ie. does the field
|
||||
* distinguish between "unset" and "present with default value."
|
||||
*
|
||||
* This includes required, optional, and oneof fields. It excludes maps,
|
||||
* repeated fields, and singular proto3 fields without "optional".
|
||||
*
|
||||
* For fields where hasPresence() == true, the return value of
|
||||
* msg.hasField() is semantically meaningful.
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public function hasOptionalKeyword()
|
||||
public function hasPresence()
|
||||
{
|
||||
return $this->internal_desc->hasOptionalKeyword();
|
||||
return $this->internal_desc->hasPresence();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -96,22 +96,20 @@
|
||||
* }
|
||||
* An implementation may provide options to override this default behavior for
|
||||
* repeated and message fields.
|
||||
* In order to reset a field's value to the default, the field must
|
||||
* be in the mask and set to the default value in the provided resource.
|
||||
* Hence, in order to reset all fields of a resource, provide a default
|
||||
* instance of the resource and set all fields in the mask, or do
|
||||
* not provide a mask as described below.
|
||||
* If a field mask is not present on update, the operation applies to
|
||||
* all fields (as if a field mask of all fields has been specified).
|
||||
* Note that in the presence of schema evolution, this may mean that
|
||||
* fields the client does not know and has therefore not filled into
|
||||
* the request will be reset to their default. If this is unwanted
|
||||
* behavior, a specific service may require a client to always specify
|
||||
* a field mask, producing an error if not.
|
||||
* As with get operations, the location of the resource which
|
||||
* describes the updated values in the request message depends on the
|
||||
* operation kind. In any case, the effect of the field mask is
|
||||
* required to be honored by the API.
|
||||
* Note that libraries which implement FieldMask resolution have various
|
||||
* different behaviors in the face of empty masks or the special "*" mask.
|
||||
* When implementing a service you should confirm these cases have the
|
||||
* appropriate behavior in the underlying FieldMask library that you desire,
|
||||
* and you may need to special case those cases in your application code if
|
||||
* the underlying field mask library behavior differs from your intended
|
||||
* service semantics.
|
||||
* Update methods implementing https://google.aip.dev/134
|
||||
* - MUST support the special value * meaning "full replace"
|
||||
* - MUST treat an omitted field mask as "replace fields which are present".
|
||||
* Other methods implementing https://google.aip.dev/157
|
||||
* - SHOULD support the special value "*" to mean "get all".
|
||||
* - MUST treat an omitted field mask to mean "get all", unless otherwise
|
||||
* documented.
|
||||
* ## Considerations for HTTP REST
|
||||
* The HTTP kind of an update operation which uses a field mask must
|
||||
* be set to PATCH instead of PUT in order to satisfy HTTP semantics
|
||||
@@ -206,7 +204,7 @@ public function getPaths()
|
||||
* @param string[] $var
|
||||
* @return $this
|
||||
*/
|
||||
public function setPaths($var)
|
||||
public function setPaths(array|RepeatedField $var)
|
||||
{
|
||||
$arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING);
|
||||
$this->paths = $arr;
|
||||
|
||||
@@ -1,16 +0,0 @@
|
||||
<?php
|
||||
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
||||
# source: google/protobuf/type.proto
|
||||
|
||||
namespace Google\Protobuf;
|
||||
|
||||
if (false) {
|
||||
/**
|
||||
* This class is deprecated. Use Google\Protobuf\Field\Cardinality instead.
|
||||
* @deprecated
|
||||
*/
|
||||
class Field_Cardinality {}
|
||||
}
|
||||
class_exists(Field\Cardinality::class);
|
||||
@trigger_error('Google\Protobuf\Field_Cardinality is deprecated and will be removed in the next major release. Use Google\Protobuf\Field\Cardinality instead', E_USER_DEPRECATED);
|
||||
|
||||
@@ -1,16 +0,0 @@
|
||||
<?php
|
||||
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
||||
# source: google/protobuf/type.proto
|
||||
|
||||
namespace Google\Protobuf;
|
||||
|
||||
if (false) {
|
||||
/**
|
||||
* This class is deprecated. Use Google\Protobuf\Field\Kind instead.
|
||||
* @deprecated
|
||||
*/
|
||||
class Field_Kind {}
|
||||
}
|
||||
class_exists(Field\Kind::class);
|
||||
@trigger_error('Google\Protobuf\Field_Kind is deprecated and will be removed in the next major release. Use Google\Protobuf\Field\Kind instead', E_USER_DEPRECATED);
|
||||
|
||||
@@ -59,9 +59,8 @@ public function getValue()
|
||||
* @param float $var
|
||||
* @return $this
|
||||
*/
|
||||
public function setValue($var)
|
||||
public function setValue(float $var)
|
||||
{
|
||||
GPBUtil::checkFloat($var);
|
||||
$this->value = $var;
|
||||
|
||||
return $this;
|
||||
|
||||
@@ -59,7 +59,7 @@ public function getValue()
|
||||
* @param int $var
|
||||
* @return $this
|
||||
*/
|
||||
public function setValue($var)
|
||||
public function setValue(int $var)
|
||||
{
|
||||
GPBUtil::checkInt32($var);
|
||||
$this->value = $var;
|
||||
|
||||
@@ -59,7 +59,7 @@ public function getValue()
|
||||
* @param int|string $var
|
||||
* @return $this
|
||||
*/
|
||||
public function setValue($var)
|
||||
public function setValue(int|string $var)
|
||||
{
|
||||
GPBUtil::checkInt64($var);
|
||||
$this->value = $var;
|
||||
|
||||
@@ -271,7 +271,8 @@ public function readTag()
|
||||
public function readRaw($size, &$buffer)
|
||||
{
|
||||
$current_buffer_size = 0;
|
||||
if ($this->bufferSize() < $size) {
|
||||
// size (varint) read from the wire could be negative.
|
||||
if ($size < 0 || $this->bufferSize() < $size) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -337,7 +338,7 @@ public function incrementRecursionDepthAndPushLimit(
|
||||
$byte_limit, &$old_limit, &$recursion_budget)
|
||||
{
|
||||
$old_limit = $this->pushLimit($byte_limit);
|
||||
$recursion_limit = --$this->recursion_limit;
|
||||
$recursion_budget = --$this->recursion_budget;
|
||||
}
|
||||
|
||||
public function decrementRecursionDepthAndPopLimit($byte_limit)
|
||||
|
||||
@@ -98,7 +98,7 @@ public static function writeVarintToArray($value, &$buffer, $trim = false)
|
||||
}
|
||||
|
||||
while (($low >= 0x80 || $low < 0) || $high != 0) {
|
||||
$buffer[$current] = chr($low | 0x80);
|
||||
$buffer[$current] = chr(($low | 0x80) & 0xFF);
|
||||
$value = ($value >> 7) & ~(0x7F << ((PHP_INT_SIZE << 3) - 7));
|
||||
$carry = ($high & 0x7F) << ((PHP_INT_SIZE << 3) - 7);
|
||||
$high = ($high >> 7) & ~(0x7F << ((PHP_INT_SIZE << 3) - 7));
|
||||
|
||||
@@ -54,7 +54,7 @@ public function getFullName()
|
||||
public function addField($field)
|
||||
{
|
||||
$this->field[$field->getNumber()] = $field;
|
||||
$this->json_to_field[$field->getJsonName()] = $field;
|
||||
$this->json_to_field[$field->getJsonName() ?? ''] = $field;
|
||||
$this->name_to_field[$field->getName()] = $field;
|
||||
$this->index_to_field[] = $field;
|
||||
}
|
||||
|
||||
@@ -75,8 +75,8 @@ public function addDescriptor($descriptor)
|
||||
$this->unique_descs[$descriptor->getFullName()] =
|
||||
$descriptor;
|
||||
$this->class_to_desc[$descriptor->getClass()] = $descriptor;
|
||||
$this->class_to_desc[$descriptor->getLegacyClass()] = $descriptor;
|
||||
$this->class_to_desc[$descriptor->getPreviouslyUnreservedClass()] = $descriptor;
|
||||
$this->class_to_desc[$descriptor->getLegacyClass() ?? ''] = $descriptor;
|
||||
$this->class_to_desc[$descriptor->getPreviouslyUnreservedClass() ?? ''] = $descriptor;
|
||||
foreach ($descriptor->getNestedType() as $nested_type) {
|
||||
$this->addDescriptor($nested_type);
|
||||
}
|
||||
@@ -90,7 +90,7 @@ public function addEnumDescriptor($descriptor)
|
||||
$this->proto_to_class[$descriptor->getFullName()] =
|
||||
$descriptor->getClass();
|
||||
$this->class_to_enum_desc[$descriptor->getClass()] = $descriptor;
|
||||
$this->class_to_enum_desc[$descriptor->getLegacyClass()] = $descriptor;
|
||||
$this->class_to_enum_desc[$descriptor->getLegacyClass() ?? ''] = $descriptor;
|
||||
}
|
||||
|
||||
public function getDescriptorByClassName($klass)
|
||||
|
||||
@@ -119,9 +119,9 @@ public function clearName()
|
||||
* @param string $var
|
||||
* @return $this
|
||||
*/
|
||||
public function setName($var)
|
||||
public function setName(string $var)
|
||||
{
|
||||
GPBUtil::checkString($var, True);
|
||||
GPBUtil::checkString($var, true);
|
||||
$this->name = $var;
|
||||
|
||||
return $this;
|
||||
@@ -141,7 +141,7 @@ public function getField()
|
||||
* @param \Google\Protobuf\Internal\FieldDescriptorProto[] $var
|
||||
* @return $this
|
||||
*/
|
||||
public function setField($var)
|
||||
public function setField(array|RepeatedField $var)
|
||||
{
|
||||
$arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Internal\FieldDescriptorProto::class);
|
||||
$this->field = $arr;
|
||||
@@ -163,7 +163,7 @@ public function getExtension()
|
||||
* @param \Google\Protobuf\Internal\FieldDescriptorProto[] $var
|
||||
* @return $this
|
||||
*/
|
||||
public function setExtension($var)
|
||||
public function setExtension(array|RepeatedField $var)
|
||||
{
|
||||
$arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Internal\FieldDescriptorProto::class);
|
||||
$this->extension = $arr;
|
||||
@@ -185,7 +185,7 @@ public function getNestedType()
|
||||
* @param \Google\Protobuf\Internal\DescriptorProto[] $var
|
||||
* @return $this
|
||||
*/
|
||||
public function setNestedType($var)
|
||||
public function setNestedType(array|RepeatedField $var)
|
||||
{
|
||||
$arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Internal\DescriptorProto::class);
|
||||
$this->nested_type = $arr;
|
||||
@@ -207,7 +207,7 @@ public function getEnumType()
|
||||
* @param \Google\Protobuf\Internal\EnumDescriptorProto[] $var
|
||||
* @return $this
|
||||
*/
|
||||
public function setEnumType($var)
|
||||
public function setEnumType(array|RepeatedField $var)
|
||||
{
|
||||
$arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Internal\EnumDescriptorProto::class);
|
||||
$this->enum_type = $arr;
|
||||
@@ -229,7 +229,7 @@ public function getExtensionRange()
|
||||
* @param \Google\Protobuf\Internal\DescriptorProto\ExtensionRange[] $var
|
||||
* @return $this
|
||||
*/
|
||||
public function setExtensionRange($var)
|
||||
public function setExtensionRange(array|RepeatedField $var)
|
||||
{
|
||||
$arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Internal\DescriptorProto\ExtensionRange::class);
|
||||
$this->extension_range = $arr;
|
||||
@@ -251,7 +251,7 @@ public function getOneofDecl()
|
||||
* @param \Google\Protobuf\Internal\OneofDescriptorProto[] $var
|
||||
* @return $this
|
||||
*/
|
||||
public function setOneofDecl($var)
|
||||
public function setOneofDecl(array|RepeatedField $var)
|
||||
{
|
||||
$arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Internal\OneofDescriptorProto::class);
|
||||
$this->oneof_decl = $arr;
|
||||
@@ -283,9 +283,8 @@ public function clearOptions()
|
||||
* @param \Google\Protobuf\Internal\MessageOptions $var
|
||||
* @return $this
|
||||
*/
|
||||
public function setOptions($var)
|
||||
public function setOptions(\Google\Protobuf\Internal\MessageOptions|null $var)
|
||||
{
|
||||
GPBUtil::checkMessage($var, \Google\Protobuf\Internal\MessageOptions::class);
|
||||
$this->options = $var;
|
||||
|
||||
return $this;
|
||||
@@ -305,7 +304,7 @@ public function getReservedRange()
|
||||
* @param \Google\Protobuf\Internal\DescriptorProto\ReservedRange[] $var
|
||||
* @return $this
|
||||
*/
|
||||
public function setReservedRange($var)
|
||||
public function setReservedRange(array|RepeatedField $var)
|
||||
{
|
||||
$arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Internal\DescriptorProto\ReservedRange::class);
|
||||
$this->reserved_range = $arr;
|
||||
@@ -333,7 +332,7 @@ public function getReservedName()
|
||||
* @param string[] $var
|
||||
* @return $this
|
||||
*/
|
||||
public function setReservedName($var)
|
||||
public function setReservedName(array|RepeatedField $var)
|
||||
{
|
||||
$arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING);
|
||||
$this->reserved_name = $arr;
|
||||
@@ -345,7 +344,7 @@ public function setReservedName($var)
|
||||
* Support for `export` and `local` keywords on enums.
|
||||
*
|
||||
* Generated from protobuf field <code>optional .google.protobuf.SymbolVisibility visibility = 11;</code>
|
||||
* @return int
|
||||
* @return int one of the values in {@see \Google\Protobuf\Internal\SymbolVisibility}
|
||||
*/
|
||||
public function getVisibility()
|
||||
{
|
||||
@@ -366,10 +365,10 @@ public function clearVisibility()
|
||||
* Support for `export` and `local` keywords on enums.
|
||||
*
|
||||
* Generated from protobuf field <code>optional .google.protobuf.SymbolVisibility visibility = 11;</code>
|
||||
* @param int $var
|
||||
* @param int $var one of the values in {@see \Google\Protobuf\Internal\SymbolVisibility}
|
||||
* @return $this
|
||||
*/
|
||||
public function setVisibility($var)
|
||||
public function setVisibility(int $var)
|
||||
{
|
||||
GPBUtil::checkEnum($var, \Google\Protobuf\Internal\SymbolVisibility::class);
|
||||
$this->visibility = $var;
|
||||
|
||||
@@ -79,7 +79,7 @@ public function clearStart()
|
||||
* @param int $var
|
||||
* @return $this
|
||||
*/
|
||||
public function setStart($var)
|
||||
public function setStart(int $var)
|
||||
{
|
||||
GPBUtil::checkInt32($var);
|
||||
$this->start = $var;
|
||||
@@ -115,7 +115,7 @@ public function clearEnd()
|
||||
* @param int $var
|
||||
* @return $this
|
||||
*/
|
||||
public function setEnd($var)
|
||||
public function setEnd(int $var)
|
||||
{
|
||||
GPBUtil::checkInt32($var);
|
||||
$this->end = $var;
|
||||
@@ -147,9 +147,8 @@ public function clearOptions()
|
||||
* @param \Google\Protobuf\Internal\ExtensionRangeOptions $var
|
||||
* @return $this
|
||||
*/
|
||||
public function setOptions($var)
|
||||
public function setOptions(\Google\Protobuf\Internal\ExtensionRangeOptions|null $var)
|
||||
{
|
||||
GPBUtil::checkMessage($var, \Google\Protobuf\Internal\ExtensionRangeOptions::class);
|
||||
$this->options = $var;
|
||||
|
||||
return $this;
|
||||
|
||||
@@ -78,7 +78,7 @@ public function clearStart()
|
||||
* @param int $var
|
||||
* @return $this
|
||||
*/
|
||||
public function setStart($var)
|
||||
public function setStart(int $var)
|
||||
{
|
||||
GPBUtil::checkInt32($var);
|
||||
$this->start = $var;
|
||||
@@ -114,7 +114,7 @@ public function clearEnd()
|
||||
* @param int $var
|
||||
* @return $this
|
||||
*/
|
||||
public function setEnd($var)
|
||||
public function setEnd(int $var)
|
||||
{
|
||||
GPBUtil::checkInt32($var);
|
||||
$this->end = $var;
|
||||
|
||||
@@ -101,9 +101,9 @@ public function clearName()
|
||||
* @param string $var
|
||||
* @return $this
|
||||
*/
|
||||
public function setName($var)
|
||||
public function setName(string $var)
|
||||
{
|
||||
GPBUtil::checkString($var, True);
|
||||
GPBUtil::checkString($var, true);
|
||||
$this->name = $var;
|
||||
|
||||
return $this;
|
||||
@@ -123,7 +123,7 @@ public function getValue()
|
||||
* @param \Google\Protobuf\Internal\EnumValueDescriptorProto[] $var
|
||||
* @return $this
|
||||
*/
|
||||
public function setValue($var)
|
||||
public function setValue(array|RepeatedField $var)
|
||||
{
|
||||
$arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Internal\EnumValueDescriptorProto::class);
|
||||
$this->value = $arr;
|
||||
@@ -155,9 +155,8 @@ public function clearOptions()
|
||||
* @param \Google\Protobuf\Internal\EnumOptions $var
|
||||
* @return $this
|
||||
*/
|
||||
public function setOptions($var)
|
||||
public function setOptions(\Google\Protobuf\Internal\EnumOptions|null $var)
|
||||
{
|
||||
GPBUtil::checkMessage($var, \Google\Protobuf\Internal\EnumOptions::class);
|
||||
$this->options = $var;
|
||||
|
||||
return $this;
|
||||
@@ -185,7 +184,7 @@ public function getReservedRange()
|
||||
* @param \Google\Protobuf\Internal\EnumDescriptorProto\EnumReservedRange[] $var
|
||||
* @return $this
|
||||
*/
|
||||
public function setReservedRange($var)
|
||||
public function setReservedRange(array|RepeatedField $var)
|
||||
{
|
||||
$arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Internal\EnumDescriptorProto\EnumReservedRange::class);
|
||||
$this->reserved_range = $arr;
|
||||
@@ -213,7 +212,7 @@ public function getReservedName()
|
||||
* @param string[] $var
|
||||
* @return $this
|
||||
*/
|
||||
public function setReservedName($var)
|
||||
public function setReservedName(array|RepeatedField $var)
|
||||
{
|
||||
$arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING);
|
||||
$this->reserved_name = $arr;
|
||||
@@ -225,7 +224,7 @@ public function setReservedName($var)
|
||||
* Support for `export` and `local` keywords on enums.
|
||||
*
|
||||
* Generated from protobuf field <code>optional .google.protobuf.SymbolVisibility visibility = 6;</code>
|
||||
* @return int
|
||||
* @return int one of the values in {@see \Google\Protobuf\Internal\SymbolVisibility}
|
||||
*/
|
||||
public function getVisibility()
|
||||
{
|
||||
@@ -246,10 +245,10 @@ public function clearVisibility()
|
||||
* Support for `export` and `local` keywords on enums.
|
||||
*
|
||||
* Generated from protobuf field <code>optional .google.protobuf.SymbolVisibility visibility = 6;</code>
|
||||
* @param int $var
|
||||
* @param int $var one of the values in {@see \Google\Protobuf\Internal\SymbolVisibility}
|
||||
* @return $this
|
||||
*/
|
||||
public function setVisibility($var)
|
||||
public function setVisibility(int $var)
|
||||
{
|
||||
GPBUtil::checkEnum($var, \Google\Protobuf\Internal\SymbolVisibility::class);
|
||||
$this->visibility = $var;
|
||||
|
||||
@@ -80,7 +80,7 @@ public function clearStart()
|
||||
* @param int $var
|
||||
* @return $this
|
||||
*/
|
||||
public function setStart($var)
|
||||
public function setStart(int $var)
|
||||
{
|
||||
GPBUtil::checkInt32($var);
|
||||
$this->start = $var;
|
||||
@@ -116,7 +116,7 @@ public function clearEnd()
|
||||
* @param int $var
|
||||
* @return $this
|
||||
*/
|
||||
public function setEnd($var)
|
||||
public function setEnd(int $var)
|
||||
{
|
||||
GPBUtil::checkInt32($var);
|
||||
$this->end = $var;
|
||||
|
||||
@@ -125,9 +125,8 @@ public function clearAllowAlias()
|
||||
* @param bool $var
|
||||
* @return $this
|
||||
*/
|
||||
public function setAllowAlias($var)
|
||||
public function setAllowAlias(bool $var)
|
||||
{
|
||||
GPBUtil::checkBool($var);
|
||||
$this->allow_alias = $var;
|
||||
|
||||
return $this;
|
||||
@@ -167,9 +166,8 @@ public function clearDeprecated()
|
||||
* @param bool $var
|
||||
* @return $this
|
||||
*/
|
||||
public function setDeprecated($var)
|
||||
public function setDeprecated(bool $var)
|
||||
{
|
||||
GPBUtil::checkBool($var);
|
||||
$this->deprecated = $var;
|
||||
|
||||
return $this;
|
||||
@@ -222,10 +220,9 @@ public function clearDeprecatedLegacyJsonFieldConflicts()
|
||||
* @return $this
|
||||
* @deprecated
|
||||
*/
|
||||
public function setDeprecatedLegacyJsonFieldConflicts($var)
|
||||
public function setDeprecatedLegacyJsonFieldConflicts(bool $var)
|
||||
{
|
||||
@trigger_error('deprecated_legacy_json_field_conflicts is deprecated.', E_USER_DEPRECATED);
|
||||
GPBUtil::checkBool($var);
|
||||
$this->deprecated_legacy_json_field_conflicts = $var;
|
||||
|
||||
return $this;
|
||||
@@ -265,9 +262,8 @@ public function clearFeatures()
|
||||
* @param \Google\Protobuf\Internal\FeatureSet $var
|
||||
* @return $this
|
||||
*/
|
||||
public function setFeatures($var)
|
||||
public function setFeatures(\Google\Protobuf\Internal\FeatureSet|null $var)
|
||||
{
|
||||
GPBUtil::checkMessage($var, \Google\Protobuf\Internal\FeatureSet::class);
|
||||
$this->features = $var;
|
||||
|
||||
return $this;
|
||||
@@ -291,7 +287,7 @@ public function getUninterpretedOption()
|
||||
* @param \Google\Protobuf\Internal\UninterpretedOption[] $var
|
||||
* @return $this
|
||||
*/
|
||||
public function setUninterpretedOption($var)
|
||||
public function setUninterpretedOption(array|RepeatedField $var)
|
||||
{
|
||||
$arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Internal\UninterpretedOption::class);
|
||||
$this->uninterpreted_option = $arr;
|
||||
|
||||
@@ -71,9 +71,9 @@ public function clearName()
|
||||
* @param string $var
|
||||
* @return $this
|
||||
*/
|
||||
public function setName($var)
|
||||
public function setName(string $var)
|
||||
{
|
||||
GPBUtil::checkString($var, True);
|
||||
GPBUtil::checkString($var, true);
|
||||
$this->name = $var;
|
||||
|
||||
return $this;
|
||||
@@ -103,7 +103,7 @@ public function clearNumber()
|
||||
* @param int $var
|
||||
* @return $this
|
||||
*/
|
||||
public function setNumber($var)
|
||||
public function setNumber(int $var)
|
||||
{
|
||||
GPBUtil::checkInt32($var);
|
||||
$this->number = $var;
|
||||
@@ -135,9 +135,8 @@ public function clearOptions()
|
||||
* @param \Google\Protobuf\Internal\EnumValueOptions $var
|
||||
* @return $this
|
||||
*/
|
||||
public function setOptions($var)
|
||||
public function setOptions(\Google\Protobuf\Internal\EnumValueOptions|null $var)
|
||||
{
|
||||
GPBUtil::checkMessage($var, \Google\Protobuf\Internal\EnumValueOptions::class);
|
||||
$this->options = $var;
|
||||
|
||||
return $this;
|
||||
|
||||
@@ -120,9 +120,8 @@ public function clearDeprecated()
|
||||
* @param bool $var
|
||||
* @return $this
|
||||
*/
|
||||
public function setDeprecated($var)
|
||||
public function setDeprecated(bool $var)
|
||||
{
|
||||
GPBUtil::checkBool($var);
|
||||
$this->deprecated = $var;
|
||||
|
||||
return $this;
|
||||
@@ -162,9 +161,8 @@ public function clearFeatures()
|
||||
* @param \Google\Protobuf\Internal\FeatureSet $var
|
||||
* @return $this
|
||||
*/
|
||||
public function setFeatures($var)
|
||||
public function setFeatures(\Google\Protobuf\Internal\FeatureSet|null $var)
|
||||
{
|
||||
GPBUtil::checkMessage($var, \Google\Protobuf\Internal\FeatureSet::class);
|
||||
$this->features = $var;
|
||||
|
||||
return $this;
|
||||
@@ -202,9 +200,8 @@ public function clearDebugRedact()
|
||||
* @param bool $var
|
||||
* @return $this
|
||||
*/
|
||||
public function setDebugRedact($var)
|
||||
public function setDebugRedact(bool $var)
|
||||
{
|
||||
GPBUtil::checkBool($var);
|
||||
$this->debug_redact = $var;
|
||||
|
||||
return $this;
|
||||
@@ -238,9 +235,8 @@ public function clearFeatureSupport()
|
||||
* @param \Google\Protobuf\Internal\FieldOptions\FeatureSupport $var
|
||||
* @return $this
|
||||
*/
|
||||
public function setFeatureSupport($var)
|
||||
public function setFeatureSupport(\Google\Protobuf\Internal\FieldOptions\FeatureSupport|null $var)
|
||||
{
|
||||
GPBUtil::checkMessage($var, \Google\Protobuf\Internal\FieldOptions\FeatureSupport::class);
|
||||
$this->feature_support = $var;
|
||||
|
||||
return $this;
|
||||
@@ -264,7 +260,7 @@ public function getUninterpretedOption()
|
||||
* @param \Google\Protobuf\Internal\UninterpretedOption[] $var
|
||||
* @return $this
|
||||
*/
|
||||
public function setUninterpretedOption($var)
|
||||
public function setUninterpretedOption(array|RepeatedField $var)
|
||||
{
|
||||
$arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Internal\UninterpretedOption::class);
|
||||
$this->uninterpreted_option = $arr;
|
||||
|
||||
@@ -88,7 +88,7 @@ public function getUninterpretedOption()
|
||||
* @param \Google\Protobuf\Internal\UninterpretedOption[] $var
|
||||
* @return $this
|
||||
*/
|
||||
public function setUninterpretedOption($var)
|
||||
public function setUninterpretedOption(array|RepeatedField $var)
|
||||
{
|
||||
$arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Internal\UninterpretedOption::class);
|
||||
$this->uninterpreted_option = $arr;
|
||||
@@ -118,7 +118,7 @@ public function getDeclaration()
|
||||
* @param \Google\Protobuf\Internal\ExtensionRangeOptions\Declaration[] $var
|
||||
* @return $this
|
||||
*/
|
||||
public function setDeclaration($var)
|
||||
public function setDeclaration(array|RepeatedField $var)
|
||||
{
|
||||
$arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Internal\ExtensionRangeOptions\Declaration::class);
|
||||
$this->declaration = $arr;
|
||||
@@ -154,9 +154,8 @@ public function clearFeatures()
|
||||
* @param \Google\Protobuf\Internal\FeatureSet $var
|
||||
* @return $this
|
||||
*/
|
||||
public function setFeatures($var)
|
||||
public function setFeatures(\Google\Protobuf\Internal\FeatureSet|null $var)
|
||||
{
|
||||
GPBUtil::checkMessage($var, \Google\Protobuf\Internal\FeatureSet::class);
|
||||
$this->features = $var;
|
||||
|
||||
return $this;
|
||||
@@ -168,11 +167,11 @@ public function setFeatures($var)
|
||||
* are marked as UNVERIFIED.
|
||||
*
|
||||
* Generated from protobuf field <code>optional .google.protobuf.ExtensionRangeOptions.VerificationState verification = 3 [default = UNVERIFIED, retention = RETENTION_SOURCE];</code>
|
||||
* @return int
|
||||
* @return int one of the values in {@see \Google\Protobuf\Internal\ExtensionRangeOptions\VerificationState}
|
||||
*/
|
||||
public function getVerification()
|
||||
{
|
||||
return isset($this->verification) ? $this->verification : 0;
|
||||
return isset($this->verification) ? $this->verification : 1;
|
||||
}
|
||||
|
||||
public function hasVerification()
|
||||
@@ -191,10 +190,10 @@ public function clearVerification()
|
||||
* are marked as UNVERIFIED.
|
||||
*
|
||||
* Generated from protobuf field <code>optional .google.protobuf.ExtensionRangeOptions.VerificationState verification = 3 [default = UNVERIFIED, retention = RETENTION_SOURCE];</code>
|
||||
* @param int $var
|
||||
* @param int $var one of the values in {@see \Google\Protobuf\Internal\ExtensionRangeOptions\VerificationState}
|
||||
* @return $this
|
||||
*/
|
||||
public function setVerification($var)
|
||||
public function setVerification(int $var)
|
||||
{
|
||||
GPBUtil::checkEnum($var, \Google\Protobuf\Internal\ExtensionRangeOptions\VerificationState::class);
|
||||
$this->verification = $var;
|
||||
|
||||
@@ -110,7 +110,7 @@ public function clearNumber()
|
||||
* @param int $var
|
||||
* @return $this
|
||||
*/
|
||||
public function setNumber($var)
|
||||
public function setNumber(int $var)
|
||||
{
|
||||
GPBUtil::checkInt32($var);
|
||||
$this->number = $var;
|
||||
@@ -148,9 +148,9 @@ public function clearFullName()
|
||||
* @param string $var
|
||||
* @return $this
|
||||
*/
|
||||
public function setFullName($var)
|
||||
public function setFullName(string $var)
|
||||
{
|
||||
GPBUtil::checkString($var, True);
|
||||
GPBUtil::checkString($var, true);
|
||||
$this->full_name = $var;
|
||||
|
||||
return $this;
|
||||
@@ -188,9 +188,9 @@ public function clearType()
|
||||
* @param string $var
|
||||
* @return $this
|
||||
*/
|
||||
public function setType($var)
|
||||
public function setType(string $var)
|
||||
{
|
||||
GPBUtil::checkString($var, True);
|
||||
GPBUtil::checkString($var, true);
|
||||
$this->type = $var;
|
||||
|
||||
return $this;
|
||||
@@ -228,9 +228,8 @@ public function clearReserved()
|
||||
* @param bool $var
|
||||
* @return $this
|
||||
*/
|
||||
public function setReserved($var)
|
||||
public function setReserved(bool $var)
|
||||
{
|
||||
GPBUtil::checkBool($var);
|
||||
$this->reserved = $var;
|
||||
|
||||
return $this;
|
||||
@@ -266,9 +265,8 @@ public function clearRepeated()
|
||||
* @param bool $var
|
||||
* @return $this
|
||||
*/
|
||||
public function setRepeated($var)
|
||||
public function setRepeated(bool $var)
|
||||
{
|
||||
GPBUtil::checkBool($var);
|
||||
$this->repeated = $var;
|
||||
|
||||
return $this;
|
||||
|
||||
@@ -79,7 +79,7 @@ public function __construct($data = NULL) {
|
||||
|
||||
/**
|
||||
* Generated from protobuf field <code>optional .google.protobuf.FeatureSet.FieldPresence field_presence = 1 [retention = RETENTION_RUNTIME, targets = TARGET_TYPE_FIELD, targets = TARGET_TYPE_FILE, edition_defaults = {</code>
|
||||
* @return int
|
||||
* @return int one of the values in {@see \Google\Protobuf\Internal\FeatureSet\FieldPresence}
|
||||
*/
|
||||
public function getFieldPresence()
|
||||
{
|
||||
@@ -98,10 +98,10 @@ public function clearFieldPresence()
|
||||
|
||||
/**
|
||||
* Generated from protobuf field <code>optional .google.protobuf.FeatureSet.FieldPresence field_presence = 1 [retention = RETENTION_RUNTIME, targets = TARGET_TYPE_FIELD, targets = TARGET_TYPE_FILE, edition_defaults = {</code>
|
||||
* @param int $var
|
||||
* @param int $var one of the values in {@see \Google\Protobuf\Internal\FeatureSet\FieldPresence}
|
||||
* @return $this
|
||||
*/
|
||||
public function setFieldPresence($var)
|
||||
public function setFieldPresence(int $var)
|
||||
{
|
||||
GPBUtil::checkEnum($var, \Google\Protobuf\Internal\FeatureSet\FieldPresence::class);
|
||||
$this->field_presence = $var;
|
||||
@@ -111,7 +111,7 @@ public function setFieldPresence($var)
|
||||
|
||||
/**
|
||||
* Generated from protobuf field <code>optional .google.protobuf.FeatureSet.EnumType enum_type = 2 [retention = RETENTION_RUNTIME, targets = TARGET_TYPE_ENUM, targets = TARGET_TYPE_FILE, edition_defaults = {</code>
|
||||
* @return int
|
||||
* @return int one of the values in {@see \Google\Protobuf\Internal\FeatureSet\EnumType}
|
||||
*/
|
||||
public function getEnumType()
|
||||
{
|
||||
@@ -130,10 +130,10 @@ public function clearEnumType()
|
||||
|
||||
/**
|
||||
* Generated from protobuf field <code>optional .google.protobuf.FeatureSet.EnumType enum_type = 2 [retention = RETENTION_RUNTIME, targets = TARGET_TYPE_ENUM, targets = TARGET_TYPE_FILE, edition_defaults = {</code>
|
||||
* @param int $var
|
||||
* @param int $var one of the values in {@see \Google\Protobuf\Internal\FeatureSet\EnumType}
|
||||
* @return $this
|
||||
*/
|
||||
public function setEnumType($var)
|
||||
public function setEnumType(int $var)
|
||||
{
|
||||
GPBUtil::checkEnum($var, \Google\Protobuf\Internal\FeatureSet\EnumType::class);
|
||||
$this->enum_type = $var;
|
||||
@@ -143,7 +143,7 @@ public function setEnumType($var)
|
||||
|
||||
/**
|
||||
* Generated from protobuf field <code>optional .google.protobuf.FeatureSet.RepeatedFieldEncoding repeated_field_encoding = 3 [retention = RETENTION_RUNTIME, targets = TARGET_TYPE_FIELD, targets = TARGET_TYPE_FILE, edition_defaults = {</code>
|
||||
* @return int
|
||||
* @return int one of the values in {@see \Google\Protobuf\Internal\FeatureSet\RepeatedFieldEncoding}
|
||||
*/
|
||||
public function getRepeatedFieldEncoding()
|
||||
{
|
||||
@@ -162,10 +162,10 @@ public function clearRepeatedFieldEncoding()
|
||||
|
||||
/**
|
||||
* Generated from protobuf field <code>optional .google.protobuf.FeatureSet.RepeatedFieldEncoding repeated_field_encoding = 3 [retention = RETENTION_RUNTIME, targets = TARGET_TYPE_FIELD, targets = TARGET_TYPE_FILE, edition_defaults = {</code>
|
||||
* @param int $var
|
||||
* @param int $var one of the values in {@see \Google\Protobuf\Internal\FeatureSet\RepeatedFieldEncoding}
|
||||
* @return $this
|
||||
*/
|
||||
public function setRepeatedFieldEncoding($var)
|
||||
public function setRepeatedFieldEncoding(int $var)
|
||||
{
|
||||
GPBUtil::checkEnum($var, \Google\Protobuf\Internal\FeatureSet\RepeatedFieldEncoding::class);
|
||||
$this->repeated_field_encoding = $var;
|
||||
@@ -175,7 +175,7 @@ public function setRepeatedFieldEncoding($var)
|
||||
|
||||
/**
|
||||
* Generated from protobuf field <code>optional .google.protobuf.FeatureSet.Utf8Validation utf8_validation = 4 [retention = RETENTION_RUNTIME, targets = TARGET_TYPE_FIELD, targets = TARGET_TYPE_FILE, edition_defaults = {</code>
|
||||
* @return int
|
||||
* @return int one of the values in {@see \Google\Protobuf\Internal\FeatureSet\Utf8Validation}
|
||||
*/
|
||||
public function getUtf8Validation()
|
||||
{
|
||||
@@ -194,10 +194,10 @@ public function clearUtf8Validation()
|
||||
|
||||
/**
|
||||
* Generated from protobuf field <code>optional .google.protobuf.FeatureSet.Utf8Validation utf8_validation = 4 [retention = RETENTION_RUNTIME, targets = TARGET_TYPE_FIELD, targets = TARGET_TYPE_FILE, edition_defaults = {</code>
|
||||
* @param int $var
|
||||
* @param int $var one of the values in {@see \Google\Protobuf\Internal\FeatureSet\Utf8Validation}
|
||||
* @return $this
|
||||
*/
|
||||
public function setUtf8Validation($var)
|
||||
public function setUtf8Validation(int $var)
|
||||
{
|
||||
GPBUtil::checkEnum($var, \Google\Protobuf\Internal\FeatureSet\Utf8Validation::class);
|
||||
$this->utf8_validation = $var;
|
||||
@@ -207,7 +207,7 @@ public function setUtf8Validation($var)
|
||||
|
||||
/**
|
||||
* Generated from protobuf field <code>optional .google.protobuf.FeatureSet.MessageEncoding message_encoding = 5 [retention = RETENTION_RUNTIME, targets = TARGET_TYPE_FIELD, targets = TARGET_TYPE_FILE, edition_defaults = {</code>
|
||||
* @return int
|
||||
* @return int one of the values in {@see \Google\Protobuf\Internal\FeatureSet\MessageEncoding}
|
||||
*/
|
||||
public function getMessageEncoding()
|
||||
{
|
||||
@@ -226,10 +226,10 @@ public function clearMessageEncoding()
|
||||
|
||||
/**
|
||||
* Generated from protobuf field <code>optional .google.protobuf.FeatureSet.MessageEncoding message_encoding = 5 [retention = RETENTION_RUNTIME, targets = TARGET_TYPE_FIELD, targets = TARGET_TYPE_FILE, edition_defaults = {</code>
|
||||
* @param int $var
|
||||
* @param int $var one of the values in {@see \Google\Protobuf\Internal\FeatureSet\MessageEncoding}
|
||||
* @return $this
|
||||
*/
|
||||
public function setMessageEncoding($var)
|
||||
public function setMessageEncoding(int $var)
|
||||
{
|
||||
GPBUtil::checkEnum($var, \Google\Protobuf\Internal\FeatureSet\MessageEncoding::class);
|
||||
$this->message_encoding = $var;
|
||||
@@ -239,7 +239,7 @@ public function setMessageEncoding($var)
|
||||
|
||||
/**
|
||||
* Generated from protobuf field <code>optional .google.protobuf.FeatureSet.JsonFormat json_format = 6 [retention = RETENTION_RUNTIME, targets = TARGET_TYPE_MESSAGE, targets = TARGET_TYPE_ENUM, targets = TARGET_TYPE_FILE, edition_defaults = {</code>
|
||||
* @return int
|
||||
* @return int one of the values in {@see \Google\Protobuf\Internal\FeatureSet\JsonFormat}
|
||||
*/
|
||||
public function getJsonFormat()
|
||||
{
|
||||
@@ -258,10 +258,10 @@ public function clearJsonFormat()
|
||||
|
||||
/**
|
||||
* Generated from protobuf field <code>optional .google.protobuf.FeatureSet.JsonFormat json_format = 6 [retention = RETENTION_RUNTIME, targets = TARGET_TYPE_MESSAGE, targets = TARGET_TYPE_ENUM, targets = TARGET_TYPE_FILE, edition_defaults = {</code>
|
||||
* @param int $var
|
||||
* @param int $var one of the values in {@see \Google\Protobuf\Internal\FeatureSet\JsonFormat}
|
||||
* @return $this
|
||||
*/
|
||||
public function setJsonFormat($var)
|
||||
public function setJsonFormat(int $var)
|
||||
{
|
||||
GPBUtil::checkEnum($var, \Google\Protobuf\Internal\FeatureSet\JsonFormat::class);
|
||||
$this->json_format = $var;
|
||||
@@ -271,7 +271,7 @@ public function setJsonFormat($var)
|
||||
|
||||
/**
|
||||
* Generated from protobuf field <code>optional .google.protobuf.FeatureSet.EnforceNamingStyle enforce_naming_style = 7 [retention = RETENTION_SOURCE, targets = TARGET_TYPE_FILE, targets = TARGET_TYPE_EXTENSION_RANGE, targets = TARGET_TYPE_MESSAGE, targets = TARGET_TYPE_FIELD, targets = TARGET_TYPE_ONEOF, targets = TARGET_TYPE_ENUM, targets = TARGET_TYPE_ENUM_ENTRY, targets = TARGET_TYPE_SERVICE, targets = TARGET_TYPE_METHOD, edition_defaults = {</code>
|
||||
* @return int
|
||||
* @return int one of the values in {@see \Google\Protobuf\Internal\FeatureSet\EnforceNamingStyle}
|
||||
*/
|
||||
public function getEnforceNamingStyle()
|
||||
{
|
||||
@@ -290,10 +290,10 @@ public function clearEnforceNamingStyle()
|
||||
|
||||
/**
|
||||
* Generated from protobuf field <code>optional .google.protobuf.FeatureSet.EnforceNamingStyle enforce_naming_style = 7 [retention = RETENTION_SOURCE, targets = TARGET_TYPE_FILE, targets = TARGET_TYPE_EXTENSION_RANGE, targets = TARGET_TYPE_MESSAGE, targets = TARGET_TYPE_FIELD, targets = TARGET_TYPE_ONEOF, targets = TARGET_TYPE_ENUM, targets = TARGET_TYPE_ENUM_ENTRY, targets = TARGET_TYPE_SERVICE, targets = TARGET_TYPE_METHOD, edition_defaults = {</code>
|
||||
* @param int $var
|
||||
* @param int $var one of the values in {@see \Google\Protobuf\Internal\FeatureSet\EnforceNamingStyle}
|
||||
* @return $this
|
||||
*/
|
||||
public function setEnforceNamingStyle($var)
|
||||
public function setEnforceNamingStyle(int $var)
|
||||
{
|
||||
GPBUtil::checkEnum($var, \Google\Protobuf\Internal\FeatureSet\EnforceNamingStyle::class);
|
||||
$this->enforce_naming_style = $var;
|
||||
@@ -303,7 +303,7 @@ public function setEnforceNamingStyle($var)
|
||||
|
||||
/**
|
||||
* Generated from protobuf field <code>optional .google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility default_symbol_visibility = 8 [retention = RETENTION_SOURCE, targets = TARGET_TYPE_FILE, edition_defaults = {</code>
|
||||
* @return int
|
||||
* @return int one of the values in {@see \Google\Protobuf\Internal\FeatureSet\VisibilityFeature\DefaultSymbolVisibility}
|
||||
*/
|
||||
public function getDefaultSymbolVisibility()
|
||||
{
|
||||
@@ -322,10 +322,10 @@ public function clearDefaultSymbolVisibility()
|
||||
|
||||
/**
|
||||
* Generated from protobuf field <code>optional .google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility default_symbol_visibility = 8 [retention = RETENTION_SOURCE, targets = TARGET_TYPE_FILE, edition_defaults = {</code>
|
||||
* @param int $var
|
||||
* @param int $var one of the values in {@see \Google\Protobuf\Internal\FeatureSet\VisibilityFeature\DefaultSymbolVisibility}
|
||||
* @return $this
|
||||
*/
|
||||
public function setDefaultSymbolVisibility($var)
|
||||
public function setDefaultSymbolVisibility(int $var)
|
||||
{
|
||||
GPBUtil::checkEnum($var, \Google\Protobuf\Internal\FeatureSet\VisibilityFeature\DefaultSymbolVisibility::class);
|
||||
$this->default_symbol_visibility = $var;
|
||||
|
||||
@@ -74,7 +74,7 @@ public function getDefaults()
|
||||
* @param \Google\Protobuf\Internal\FeatureSetDefaults\FeatureSetEditionDefault[] $var
|
||||
* @return $this
|
||||
*/
|
||||
public function setDefaults($var)
|
||||
public function setDefaults(array|RepeatedField $var)
|
||||
{
|
||||
$arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Internal\FeatureSetDefaults\FeatureSetEditionDefault::class);
|
||||
$this->defaults = $arr;
|
||||
@@ -87,7 +87,7 @@ public function setDefaults($var)
|
||||
* Editions before this will not have defaults.
|
||||
*
|
||||
* Generated from protobuf field <code>optional .google.protobuf.Edition minimum_edition = 4;</code>
|
||||
* @return int
|
||||
* @return int one of the values in {@see \Google\Protobuf\Internal\Edition}
|
||||
*/
|
||||
public function getMinimumEdition()
|
||||
{
|
||||
@@ -109,10 +109,10 @@ public function clearMinimumEdition()
|
||||
* Editions before this will not have defaults.
|
||||
*
|
||||
* Generated from protobuf field <code>optional .google.protobuf.Edition minimum_edition = 4;</code>
|
||||
* @param int $var
|
||||
* @param int $var one of the values in {@see \Google\Protobuf\Internal\Edition}
|
||||
* @return $this
|
||||
*/
|
||||
public function setMinimumEdition($var)
|
||||
public function setMinimumEdition(int $var)
|
||||
{
|
||||
GPBUtil::checkEnum($var, \Google\Protobuf\Internal\Edition::class);
|
||||
$this->minimum_edition = $var;
|
||||
@@ -125,7 +125,7 @@ public function setMinimumEdition($var)
|
||||
* after this will not have reliable defaults.
|
||||
*
|
||||
* Generated from protobuf field <code>optional .google.protobuf.Edition maximum_edition = 5;</code>
|
||||
* @return int
|
||||
* @return int one of the values in {@see \Google\Protobuf\Internal\Edition}
|
||||
*/
|
||||
public function getMaximumEdition()
|
||||
{
|
||||
@@ -147,10 +147,10 @@ public function clearMaximumEdition()
|
||||
* after this will not have reliable defaults.
|
||||
*
|
||||
* Generated from protobuf field <code>optional .google.protobuf.Edition maximum_edition = 5;</code>
|
||||
* @param int $var
|
||||
* @param int $var one of the values in {@see \Google\Protobuf\Internal\Edition}
|
||||
* @return $this
|
||||
*/
|
||||
public function setMaximumEdition($var)
|
||||
public function setMaximumEdition(int $var)
|
||||
{
|
||||
GPBUtil::checkEnum($var, \Google\Protobuf\Internal\Edition::class);
|
||||
$this->maximum_edition = $var;
|
||||
|
||||
@@ -58,7 +58,7 @@ public function __construct($data = NULL) {
|
||||
|
||||
/**
|
||||
* Generated from protobuf field <code>optional .google.protobuf.Edition edition = 3;</code>
|
||||
* @return int
|
||||
* @return int one of the values in {@see \Google\Protobuf\Internal\Edition}
|
||||
*/
|
||||
public function getEdition()
|
||||
{
|
||||
@@ -77,10 +77,10 @@ public function clearEdition()
|
||||
|
||||
/**
|
||||
* Generated from protobuf field <code>optional .google.protobuf.Edition edition = 3;</code>
|
||||
* @param int $var
|
||||
* @param int $var one of the values in {@see \Google\Protobuf\Internal\Edition}
|
||||
* @return $this
|
||||
*/
|
||||
public function setEdition($var)
|
||||
public function setEdition(int $var)
|
||||
{
|
||||
GPBUtil::checkEnum($var, \Google\Protobuf\Internal\Edition::class);
|
||||
$this->edition = $var;
|
||||
@@ -116,9 +116,8 @@ public function clearOverridableFeatures()
|
||||
* @param \Google\Protobuf\Internal\FeatureSet $var
|
||||
* @return $this
|
||||
*/
|
||||
public function setOverridableFeatures($var)
|
||||
public function setOverridableFeatures(\Google\Protobuf\Internal\FeatureSet|null $var)
|
||||
{
|
||||
GPBUtil::checkMessage($var, \Google\Protobuf\Internal\FeatureSet::class);
|
||||
$this->overridable_features = $var;
|
||||
|
||||
return $this;
|
||||
@@ -152,9 +151,8 @@ public function clearFixedFeatures()
|
||||
* @param \Google\Protobuf\Internal\FeatureSet $var
|
||||
* @return $this
|
||||
*/
|
||||
public function setFixedFeatures($var)
|
||||
public function setFixedFeatures(\Google\Protobuf\Internal\FeatureSet|null $var)
|
||||
{
|
||||
GPBUtil::checkMessage($var, \Google\Protobuf\Internal\FeatureSet::class);
|
||||
$this->fixed_features = $var;
|
||||
|
||||
return $this;
|
||||
|
||||
@@ -99,11 +99,6 @@ public function setLabel($label)
|
||||
$this->label = $label;
|
||||
}
|
||||
|
||||
public function getLabel()
|
||||
{
|
||||
return $this->label;
|
||||
}
|
||||
|
||||
public function isRequired()
|
||||
{
|
||||
return $this->label === GPBLabel::REQUIRED;
|
||||
@@ -164,6 +159,15 @@ public function setProto3Optional($proto3_optional)
|
||||
$this->proto3_optional = $proto3_optional;
|
||||
}
|
||||
|
||||
public function hasPresence()
|
||||
{
|
||||
if ($this->isRepeated()) {
|
||||
return false;
|
||||
}
|
||||
return $this->getType() == GPBType::MESSAGE ||
|
||||
!is_null($this->containing_oneof);
|
||||
}
|
||||
|
||||
public function getContainingOneof()
|
||||
{
|
||||
return $this->containing_oneof;
|
||||
|
||||
@@ -192,9 +192,9 @@ public function clearName()
|
||||
* @param string $var
|
||||
* @return $this
|
||||
*/
|
||||
public function setName($var)
|
||||
public function setName(string $var)
|
||||
{
|
||||
GPBUtil::checkString($var, True);
|
||||
GPBUtil::checkString($var, true);
|
||||
$this->name = $var;
|
||||
|
||||
return $this;
|
||||
@@ -224,7 +224,7 @@ public function clearNumber()
|
||||
* @param int $var
|
||||
* @return $this
|
||||
*/
|
||||
public function setNumber($var)
|
||||
public function setNumber(int $var)
|
||||
{
|
||||
GPBUtil::checkInt32($var);
|
||||
$this->number = $var;
|
||||
@@ -234,7 +234,7 @@ public function setNumber($var)
|
||||
|
||||
/**
|
||||
* Generated from protobuf field <code>optional .google.protobuf.FieldDescriptorProto.Label label = 4;</code>
|
||||
* @return int
|
||||
* @return int one of the values in {@see \Google\Protobuf\Internal\FieldDescriptorProto\Label}
|
||||
*/
|
||||
public function getLabel()
|
||||
{
|
||||
@@ -253,10 +253,10 @@ public function clearLabel()
|
||||
|
||||
/**
|
||||
* Generated from protobuf field <code>optional .google.protobuf.FieldDescriptorProto.Label label = 4;</code>
|
||||
* @param int $var
|
||||
* @param int $var one of the values in {@see \Google\Protobuf\Internal\FieldDescriptorProto\Label}
|
||||
* @return $this
|
||||
*/
|
||||
public function setLabel($var)
|
||||
public function setLabel(int $var)
|
||||
{
|
||||
GPBUtil::checkEnum($var, \Google\Protobuf\Internal\FieldDescriptorProto\Label::class);
|
||||
$this->label = $var;
|
||||
@@ -269,7 +269,7 @@ public function setLabel($var)
|
||||
* are set, this must be one of TYPE_ENUM, TYPE_MESSAGE or TYPE_GROUP.
|
||||
*
|
||||
* Generated from protobuf field <code>optional .google.protobuf.FieldDescriptorProto.Type type = 5;</code>
|
||||
* @return int
|
||||
* @return int one of the values in {@see \Google\Protobuf\Internal\FieldDescriptorProto\Type}
|
||||
*/
|
||||
public function getType()
|
||||
{
|
||||
@@ -291,10 +291,10 @@ public function clearType()
|
||||
* are set, this must be one of TYPE_ENUM, TYPE_MESSAGE or TYPE_GROUP.
|
||||
*
|
||||
* Generated from protobuf field <code>optional .google.protobuf.FieldDescriptorProto.Type type = 5;</code>
|
||||
* @param int $var
|
||||
* @param int $var one of the values in {@see \Google\Protobuf\Internal\FieldDescriptorProto\Type}
|
||||
* @return $this
|
||||
*/
|
||||
public function setType($var)
|
||||
public function setType(int $var)
|
||||
{
|
||||
GPBUtil::checkEnum($var, \Google\Protobuf\Internal\FieldDescriptorProto\Type::class);
|
||||
$this->type = $var;
|
||||
@@ -338,9 +338,9 @@ public function clearTypeName()
|
||||
* @param string $var
|
||||
* @return $this
|
||||
*/
|
||||
public function setTypeName($var)
|
||||
public function setTypeName(string $var)
|
||||
{
|
||||
GPBUtil::checkString($var, True);
|
||||
GPBUtil::checkString($var, true);
|
||||
$this->type_name = $var;
|
||||
|
||||
return $this;
|
||||
@@ -376,9 +376,9 @@ public function clearExtendee()
|
||||
* @param string $var
|
||||
* @return $this
|
||||
*/
|
||||
public function setExtendee($var)
|
||||
public function setExtendee(string $var)
|
||||
{
|
||||
GPBUtil::checkString($var, True);
|
||||
GPBUtil::checkString($var, true);
|
||||
$this->extendee = $var;
|
||||
|
||||
return $this;
|
||||
@@ -418,9 +418,9 @@ public function clearDefaultValue()
|
||||
* @param string $var
|
||||
* @return $this
|
||||
*/
|
||||
public function setDefaultValue($var)
|
||||
public function setDefaultValue(string $var)
|
||||
{
|
||||
GPBUtil::checkString($var, True);
|
||||
GPBUtil::checkString($var, true);
|
||||
$this->default_value = $var;
|
||||
|
||||
return $this;
|
||||
@@ -456,7 +456,7 @@ public function clearOneofIndex()
|
||||
* @param int $var
|
||||
* @return $this
|
||||
*/
|
||||
public function setOneofIndex($var)
|
||||
public function setOneofIndex(int $var)
|
||||
{
|
||||
GPBUtil::checkInt32($var);
|
||||
$this->oneof_index = $var;
|
||||
@@ -498,9 +498,9 @@ public function clearJsonName()
|
||||
* @param string $var
|
||||
* @return $this
|
||||
*/
|
||||
public function setJsonName($var)
|
||||
public function setJsonName(string $var)
|
||||
{
|
||||
GPBUtil::checkString($var, True);
|
||||
GPBUtil::checkString($var, true);
|
||||
$this->json_name = $var;
|
||||
|
||||
return $this;
|
||||
@@ -530,9 +530,8 @@ public function clearOptions()
|
||||
* @param \Google\Protobuf\Internal\FieldOptions $var
|
||||
* @return $this
|
||||
*/
|
||||
public function setOptions($var)
|
||||
public function setOptions(\Google\Protobuf\Internal\FieldOptions|null $var)
|
||||
{
|
||||
GPBUtil::checkMessage($var, \Google\Protobuf\Internal\FieldOptions::class);
|
||||
$this->options = $var;
|
||||
|
||||
return $this;
|
||||
@@ -600,9 +599,8 @@ public function clearProto3Optional()
|
||||
* @param bool $var
|
||||
* @return $this
|
||||
*/
|
||||
public function setProto3Optional($var)
|
||||
public function setProto3Optional(bool $var)
|
||||
{
|
||||
GPBUtil::checkBool($var);
|
||||
$this->proto3_optional = $var;
|
||||
|
||||
return $this;
|
||||
|
||||
@@ -239,7 +239,7 @@ public function __construct($data = NULL) {
|
||||
* TODO: make ctype actually deprecated.
|
||||
*
|
||||
* Generated from protobuf field <code>optional .google.protobuf.FieldOptions.CType ctype = 1 [default = STRING];</code>
|
||||
* @return int
|
||||
* @return int one of the values in {@see \Google\Protobuf\Internal\FieldOptions\CType}
|
||||
*/
|
||||
public function getCtype()
|
||||
{
|
||||
@@ -266,10 +266,10 @@ public function clearCtype()
|
||||
* TODO: make ctype actually deprecated.
|
||||
*
|
||||
* Generated from protobuf field <code>optional .google.protobuf.FieldOptions.CType ctype = 1 [default = STRING];</code>
|
||||
* @param int $var
|
||||
* @param int $var one of the values in {@see \Google\Protobuf\Internal\FieldOptions\CType}
|
||||
* @return $this
|
||||
*/
|
||||
public function setCtype($var)
|
||||
public function setCtype(int $var)
|
||||
{
|
||||
GPBUtil::checkEnum($var, \Google\Protobuf\Internal\FieldOptions\CType::class);
|
||||
$this->ctype = $var;
|
||||
@@ -317,9 +317,8 @@ public function clearPacked()
|
||||
* @param bool $var
|
||||
* @return $this
|
||||
*/
|
||||
public function setPacked($var)
|
||||
public function setPacked(bool $var)
|
||||
{
|
||||
GPBUtil::checkBool($var);
|
||||
$this->packed = $var;
|
||||
|
||||
return $this;
|
||||
@@ -338,7 +337,7 @@ public function setPacked($var)
|
||||
* goog.math.Integer.
|
||||
*
|
||||
* Generated from protobuf field <code>optional .google.protobuf.FieldOptions.JSType jstype = 6 [default = JS_NORMAL];</code>
|
||||
* @return int
|
||||
* @return int one of the values in {@see \Google\Protobuf\Internal\FieldOptions\JSType}
|
||||
*/
|
||||
public function getJstype()
|
||||
{
|
||||
@@ -368,10 +367,10 @@ public function clearJstype()
|
||||
* goog.math.Integer.
|
||||
*
|
||||
* Generated from protobuf field <code>optional .google.protobuf.FieldOptions.JSType jstype = 6 [default = JS_NORMAL];</code>
|
||||
* @param int $var
|
||||
* @param int $var one of the values in {@see \Google\Protobuf\Internal\FieldOptions\JSType}
|
||||
* @return $this
|
||||
*/
|
||||
public function setJstype($var)
|
||||
public function setJstype(int $var)
|
||||
{
|
||||
GPBUtil::checkEnum($var, \Google\Protobuf\Internal\FieldOptions\JSType::class);
|
||||
$this->jstype = $var;
|
||||
@@ -443,9 +442,8 @@ public function clearLazy()
|
||||
* @param bool $var
|
||||
* @return $this
|
||||
*/
|
||||
public function setLazy($var)
|
||||
public function setLazy(bool $var)
|
||||
{
|
||||
GPBUtil::checkBool($var);
|
||||
$this->lazy = $var;
|
||||
|
||||
return $this;
|
||||
@@ -483,9 +481,8 @@ public function clearUnverifiedLazy()
|
||||
* @param bool $var
|
||||
* @return $this
|
||||
*/
|
||||
public function setUnverifiedLazy($var)
|
||||
public function setUnverifiedLazy(bool $var)
|
||||
{
|
||||
GPBUtil::checkBool($var);
|
||||
$this->unverified_lazy = $var;
|
||||
|
||||
return $this;
|
||||
@@ -525,9 +522,8 @@ public function clearDeprecated()
|
||||
* @param bool $var
|
||||
* @return $this
|
||||
*/
|
||||
public function setDeprecated($var)
|
||||
public function setDeprecated(bool $var)
|
||||
{
|
||||
GPBUtil::checkBool($var);
|
||||
$this->deprecated = $var;
|
||||
|
||||
return $this;
|
||||
@@ -572,10 +568,9 @@ public function clearWeak()
|
||||
* @return $this
|
||||
* @deprecated
|
||||
*/
|
||||
public function setWeak($var)
|
||||
public function setWeak(bool $var)
|
||||
{
|
||||
@trigger_error('weak is deprecated.', E_USER_DEPRECATED);
|
||||
GPBUtil::checkBool($var);
|
||||
$this->weak = $var;
|
||||
|
||||
return $this;
|
||||
@@ -611,9 +606,8 @@ public function clearDebugRedact()
|
||||
* @param bool $var
|
||||
* @return $this
|
||||
*/
|
||||
public function setDebugRedact($var)
|
||||
public function setDebugRedact(bool $var)
|
||||
{
|
||||
GPBUtil::checkBool($var);
|
||||
$this->debug_redact = $var;
|
||||
|
||||
return $this;
|
||||
@@ -621,7 +615,7 @@ public function setDebugRedact($var)
|
||||
|
||||
/**
|
||||
* Generated from protobuf field <code>optional .google.protobuf.FieldOptions.OptionRetention retention = 17;</code>
|
||||
* @return int
|
||||
* @return int one of the values in {@see \Google\Protobuf\Internal\FieldOptions\OptionRetention}
|
||||
*/
|
||||
public function getRetention()
|
||||
{
|
||||
@@ -640,10 +634,10 @@ public function clearRetention()
|
||||
|
||||
/**
|
||||
* Generated from protobuf field <code>optional .google.protobuf.FieldOptions.OptionRetention retention = 17;</code>
|
||||
* @param int $var
|
||||
* @param int $var one of the values in {@see \Google\Protobuf\Internal\FieldOptions\OptionRetention}
|
||||
* @return $this
|
||||
*/
|
||||
public function setRetention($var)
|
||||
public function setRetention(int $var)
|
||||
{
|
||||
GPBUtil::checkEnum($var, \Google\Protobuf\Internal\FieldOptions\OptionRetention::class);
|
||||
$this->retention = $var;
|
||||
@@ -653,7 +647,7 @@ public function setRetention($var)
|
||||
|
||||
/**
|
||||
* Generated from protobuf field <code>repeated .google.protobuf.FieldOptions.OptionTargetType targets = 19;</code>
|
||||
* @return RepeatedField<int>
|
||||
* @return RepeatedField<int> one of the values in {@see \Google\Protobuf\Internal\FieldOptions\OptionTargetType}
|
||||
*/
|
||||
public function getTargets()
|
||||
{
|
||||
@@ -662,10 +656,10 @@ public function getTargets()
|
||||
|
||||
/**
|
||||
* Generated from protobuf field <code>repeated .google.protobuf.FieldOptions.OptionTargetType targets = 19;</code>
|
||||
* @param int[] $var
|
||||
* @param int[] $var one of the values in {@see \Google\Protobuf\Internal\FieldOptions\OptionTargetType}
|
||||
* @return $this
|
||||
*/
|
||||
public function setTargets($var)
|
||||
public function setTargets(array|RepeatedField $var)
|
||||
{
|
||||
$arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::ENUM, \Google\Protobuf\Internal\FieldOptions\OptionTargetType::class);
|
||||
$this->targets = $arr;
|
||||
@@ -687,7 +681,7 @@ public function getEditionDefaults()
|
||||
* @param \Google\Protobuf\Internal\FieldOptions\EditionDefault[] $var
|
||||
* @return $this
|
||||
*/
|
||||
public function setEditionDefaults($var)
|
||||
public function setEditionDefaults(array|RepeatedField $var)
|
||||
{
|
||||
$arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Internal\FieldOptions\EditionDefault::class);
|
||||
$this->edition_defaults = $arr;
|
||||
@@ -729,9 +723,8 @@ public function clearFeatures()
|
||||
* @param \Google\Protobuf\Internal\FeatureSet $var
|
||||
* @return $this
|
||||
*/
|
||||
public function setFeatures($var)
|
||||
public function setFeatures(\Google\Protobuf\Internal\FeatureSet|null $var)
|
||||
{
|
||||
GPBUtil::checkMessage($var, \Google\Protobuf\Internal\FeatureSet::class);
|
||||
$this->features = $var;
|
||||
|
||||
return $this;
|
||||
@@ -761,9 +754,8 @@ public function clearFeatureSupport()
|
||||
* @param \Google\Protobuf\Internal\FieldOptions\FeatureSupport $var
|
||||
* @return $this
|
||||
*/
|
||||
public function setFeatureSupport($var)
|
||||
public function setFeatureSupport(\Google\Protobuf\Internal\FieldOptions\FeatureSupport|null $var)
|
||||
{
|
||||
GPBUtil::checkMessage($var, \Google\Protobuf\Internal\FieldOptions\FeatureSupport::class);
|
||||
$this->feature_support = $var;
|
||||
|
||||
return $this;
|
||||
@@ -787,7 +779,7 @@ public function getUninterpretedOption()
|
||||
* @param \Google\Protobuf\Internal\UninterpretedOption[] $var
|
||||
* @return $this
|
||||
*/
|
||||
public function setUninterpretedOption($var)
|
||||
public function setUninterpretedOption(array|RepeatedField $var)
|
||||
{
|
||||
$arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Internal\UninterpretedOption::class);
|
||||
$this->uninterpreted_option = $arr;
|
||||
|
||||
@@ -45,7 +45,7 @@ public function __construct($data = NULL) {
|
||||
|
||||
/**
|
||||
* Generated from protobuf field <code>optional .google.protobuf.Edition edition = 3;</code>
|
||||
* @return int
|
||||
* @return int one of the values in {@see \Google\Protobuf\Internal\Edition}
|
||||
*/
|
||||
public function getEdition()
|
||||
{
|
||||
@@ -64,10 +64,10 @@ public function clearEdition()
|
||||
|
||||
/**
|
||||
* Generated from protobuf field <code>optional .google.protobuf.Edition edition = 3;</code>
|
||||
* @param int $var
|
||||
* @param int $var one of the values in {@see \Google\Protobuf\Internal\Edition}
|
||||
* @return $this
|
||||
*/
|
||||
public function setEdition($var)
|
||||
public function setEdition(int $var)
|
||||
{
|
||||
GPBUtil::checkEnum($var, \Google\Protobuf\Internal\Edition::class);
|
||||
$this->edition = $var;
|
||||
@@ -103,9 +103,9 @@ public function clearValue()
|
||||
* @param string $var
|
||||
* @return $this
|
||||
*/
|
||||
public function setValue($var)
|
||||
public function setValue(string $var)
|
||||
{
|
||||
GPBUtil::checkString($var, True);
|
||||
GPBUtil::checkString($var, true);
|
||||
$this->value = $var;
|
||||
|
||||
return $this;
|
||||
|
||||
@@ -48,6 +48,13 @@ class FeatureSupport extends \Google\Protobuf\Internal\Message
|
||||
* Generated from protobuf field <code>optional .google.protobuf.Edition edition_removed = 4;</code>
|
||||
*/
|
||||
protected $edition_removed = null;
|
||||
/**
|
||||
* The removal error text if this feature is used after the edition it was
|
||||
* removed in.
|
||||
*
|
||||
* Generated from protobuf field <code>optional string removal_error = 5;</code>
|
||||
*/
|
||||
protected $removal_error = null;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
@@ -69,6 +76,9 @@ class FeatureSupport extends \Google\Protobuf\Internal\Message
|
||||
* The edition this feature is no longer available in. In editions after
|
||||
* this one, the last default assigned will be used, and proto files will
|
||||
* not be able to override it.
|
||||
* @type string $removal_error
|
||||
* The removal error text if this feature is used after the edition it was
|
||||
* removed in.
|
||||
* }
|
||||
*/
|
||||
public function __construct($data = NULL) {
|
||||
@@ -82,7 +92,7 @@ public function __construct($data = NULL) {
|
||||
* used, and proto files will not be able to override it.
|
||||
*
|
||||
* Generated from protobuf field <code>optional .google.protobuf.Edition edition_introduced = 1;</code>
|
||||
* @return int
|
||||
* @return int one of the values in {@see \Google\Protobuf\Internal\Edition}
|
||||
*/
|
||||
public function getEditionIntroduced()
|
||||
{
|
||||
@@ -105,10 +115,10 @@ public function clearEditionIntroduced()
|
||||
* used, and proto files will not be able to override it.
|
||||
*
|
||||
* Generated from protobuf field <code>optional .google.protobuf.Edition edition_introduced = 1;</code>
|
||||
* @param int $var
|
||||
* @param int $var one of the values in {@see \Google\Protobuf\Internal\Edition}
|
||||
* @return $this
|
||||
*/
|
||||
public function setEditionIntroduced($var)
|
||||
public function setEditionIntroduced(int $var)
|
||||
{
|
||||
GPBUtil::checkEnum($var, \Google\Protobuf\Internal\Edition::class);
|
||||
$this->edition_introduced = $var;
|
||||
@@ -121,7 +131,7 @@ public function setEditionIntroduced($var)
|
||||
* edition may trigger warnings.
|
||||
*
|
||||
* Generated from protobuf field <code>optional .google.protobuf.Edition edition_deprecated = 2;</code>
|
||||
* @return int
|
||||
* @return int one of the values in {@see \Google\Protobuf\Internal\Edition}
|
||||
*/
|
||||
public function getEditionDeprecated()
|
||||
{
|
||||
@@ -143,10 +153,10 @@ public function clearEditionDeprecated()
|
||||
* edition may trigger warnings.
|
||||
*
|
||||
* Generated from protobuf field <code>optional .google.protobuf.Edition edition_deprecated = 2;</code>
|
||||
* @param int $var
|
||||
* @param int $var one of the values in {@see \Google\Protobuf\Internal\Edition}
|
||||
* @return $this
|
||||
*/
|
||||
public function setEditionDeprecated($var)
|
||||
public function setEditionDeprecated(int $var)
|
||||
{
|
||||
GPBUtil::checkEnum($var, \Google\Protobuf\Internal\Edition::class);
|
||||
$this->edition_deprecated = $var;
|
||||
@@ -184,9 +194,9 @@ public function clearDeprecationWarning()
|
||||
* @param string $var
|
||||
* @return $this
|
||||
*/
|
||||
public function setDeprecationWarning($var)
|
||||
public function setDeprecationWarning(string $var)
|
||||
{
|
||||
GPBUtil::checkString($var, True);
|
||||
GPBUtil::checkString($var, true);
|
||||
$this->deprecation_warning = $var;
|
||||
|
||||
return $this;
|
||||
@@ -198,7 +208,7 @@ public function setDeprecationWarning($var)
|
||||
* not be able to override it.
|
||||
*
|
||||
* Generated from protobuf field <code>optional .google.protobuf.Edition edition_removed = 4;</code>
|
||||
* @return int
|
||||
* @return int one of the values in {@see \Google\Protobuf\Internal\Edition}
|
||||
*/
|
||||
public function getEditionRemoved()
|
||||
{
|
||||
@@ -221,10 +231,10 @@ public function clearEditionRemoved()
|
||||
* not be able to override it.
|
||||
*
|
||||
* Generated from protobuf field <code>optional .google.protobuf.Edition edition_removed = 4;</code>
|
||||
* @param int $var
|
||||
* @param int $var one of the values in {@see \Google\Protobuf\Internal\Edition}
|
||||
* @return $this
|
||||
*/
|
||||
public function setEditionRemoved($var)
|
||||
public function setEditionRemoved(int $var)
|
||||
{
|
||||
GPBUtil::checkEnum($var, \Google\Protobuf\Internal\Edition::class);
|
||||
$this->edition_removed = $var;
|
||||
@@ -232,5 +242,43 @@ public function setEditionRemoved($var)
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The removal error text if this feature is used after the edition it was
|
||||
* removed in.
|
||||
*
|
||||
* Generated from protobuf field <code>optional string removal_error = 5;</code>
|
||||
* @return string
|
||||
*/
|
||||
public function getRemovalError()
|
||||
{
|
||||
return isset($this->removal_error) ? $this->removal_error : '';
|
||||
}
|
||||
|
||||
public function hasRemovalError()
|
||||
{
|
||||
return isset($this->removal_error);
|
||||
}
|
||||
|
||||
public function clearRemovalError()
|
||||
{
|
||||
unset($this->removal_error);
|
||||
}
|
||||
|
||||
/**
|
||||
* The removal error text if this feature is used after the edition it was
|
||||
* removed in.
|
||||
*
|
||||
* Generated from protobuf field <code>optional string removal_error = 5;</code>
|
||||
* @param string $var
|
||||
* @return $this
|
||||
*/
|
||||
public function setRemovalError(string $var)
|
||||
{
|
||||
GPBUtil::checkString($var, true);
|
||||
$this->removal_error = $var;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -186,9 +186,9 @@ public function clearName()
|
||||
* @param string $var
|
||||
* @return $this
|
||||
*/
|
||||
public function setName($var)
|
||||
public function setName(string $var)
|
||||
{
|
||||
GPBUtil::checkString($var, True);
|
||||
GPBUtil::checkString($var, true);
|
||||
$this->name = $var;
|
||||
|
||||
return $this;
|
||||
@@ -222,9 +222,9 @@ public function clearPackage()
|
||||
* @param string $var
|
||||
* @return $this
|
||||
*/
|
||||
public function setPackage($var)
|
||||
public function setPackage(string $var)
|
||||
{
|
||||
GPBUtil::checkString($var, True);
|
||||
GPBUtil::checkString($var, true);
|
||||
$this->package = $var;
|
||||
|
||||
return $this;
|
||||
@@ -248,7 +248,7 @@ public function getDependency()
|
||||
* @param string[] $var
|
||||
* @return $this
|
||||
*/
|
||||
public function setDependency($var)
|
||||
public function setDependency(array|RepeatedField $var)
|
||||
{
|
||||
$arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING);
|
||||
$this->dependency = $arr;
|
||||
@@ -274,7 +274,7 @@ public function getPublicDependency()
|
||||
* @param int[] $var
|
||||
* @return $this
|
||||
*/
|
||||
public function setPublicDependency($var)
|
||||
public function setPublicDependency(array|RepeatedField $var)
|
||||
{
|
||||
$arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::INT32);
|
||||
$this->public_dependency = $arr;
|
||||
@@ -302,7 +302,7 @@ public function getWeakDependency()
|
||||
* @param int[] $var
|
||||
* @return $this
|
||||
*/
|
||||
public function setWeakDependency($var)
|
||||
public function setWeakDependency(array|RepeatedField $var)
|
||||
{
|
||||
$arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::INT32);
|
||||
$this->weak_dependency = $arr;
|
||||
@@ -330,7 +330,7 @@ public function getOptionDependency()
|
||||
* @param string[] $var
|
||||
* @return $this
|
||||
*/
|
||||
public function setOptionDependency($var)
|
||||
public function setOptionDependency(array|RepeatedField $var)
|
||||
{
|
||||
$arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING);
|
||||
$this->option_dependency = $arr;
|
||||
@@ -356,7 +356,7 @@ public function getMessageType()
|
||||
* @param \Google\Protobuf\Internal\DescriptorProto[] $var
|
||||
* @return $this
|
||||
*/
|
||||
public function setMessageType($var)
|
||||
public function setMessageType(array|RepeatedField $var)
|
||||
{
|
||||
$arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Internal\DescriptorProto::class);
|
||||
$this->message_type = $arr;
|
||||
@@ -378,7 +378,7 @@ public function getEnumType()
|
||||
* @param \Google\Protobuf\Internal\EnumDescriptorProto[] $var
|
||||
* @return $this
|
||||
*/
|
||||
public function setEnumType($var)
|
||||
public function setEnumType(array|RepeatedField $var)
|
||||
{
|
||||
$arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Internal\EnumDescriptorProto::class);
|
||||
$this->enum_type = $arr;
|
||||
@@ -400,7 +400,7 @@ public function getService()
|
||||
* @param \Google\Protobuf\Internal\ServiceDescriptorProto[] $var
|
||||
* @return $this
|
||||
*/
|
||||
public function setService($var)
|
||||
public function setService(array|RepeatedField $var)
|
||||
{
|
||||
$arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Internal\ServiceDescriptorProto::class);
|
||||
$this->service = $arr;
|
||||
@@ -422,7 +422,7 @@ public function getExtension()
|
||||
* @param \Google\Protobuf\Internal\FieldDescriptorProto[] $var
|
||||
* @return $this
|
||||
*/
|
||||
public function setExtension($var)
|
||||
public function setExtension(array|RepeatedField $var)
|
||||
{
|
||||
$arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Internal\FieldDescriptorProto::class);
|
||||
$this->extension = $arr;
|
||||
@@ -454,9 +454,8 @@ public function clearOptions()
|
||||
* @param \Google\Protobuf\Internal\FileOptions $var
|
||||
* @return $this
|
||||
*/
|
||||
public function setOptions($var)
|
||||
public function setOptions(\Google\Protobuf\Internal\FileOptions|null $var)
|
||||
{
|
||||
GPBUtil::checkMessage($var, \Google\Protobuf\Internal\FileOptions::class);
|
||||
$this->options = $var;
|
||||
|
||||
return $this;
|
||||
@@ -496,9 +495,8 @@ public function clearSourceCodeInfo()
|
||||
* @param \Google\Protobuf\Internal\SourceCodeInfo $var
|
||||
* @return $this
|
||||
*/
|
||||
public function setSourceCodeInfo($var)
|
||||
public function setSourceCodeInfo(\Google\Protobuf\Internal\SourceCodeInfo|null $var)
|
||||
{
|
||||
GPBUtil::checkMessage($var, \Google\Protobuf\Internal\SourceCodeInfo::class);
|
||||
$this->source_code_info = $var;
|
||||
|
||||
return $this;
|
||||
@@ -542,9 +540,9 @@ public function clearSyntax()
|
||||
* @param string $var
|
||||
* @return $this
|
||||
*/
|
||||
public function setSyntax($var)
|
||||
public function setSyntax(string $var)
|
||||
{
|
||||
GPBUtil::checkString($var, True);
|
||||
GPBUtil::checkString($var, true);
|
||||
$this->syntax = $var;
|
||||
|
||||
return $this;
|
||||
@@ -557,7 +555,7 @@ public function setSyntax($var)
|
||||
* developers should rely on the protoreflect APIs for their client language.
|
||||
*
|
||||
* Generated from protobuf field <code>optional .google.protobuf.Edition edition = 14;</code>
|
||||
* @return int
|
||||
* @return int one of the values in {@see \Google\Protobuf\Internal\Edition}
|
||||
*/
|
||||
public function getEdition()
|
||||
{
|
||||
@@ -581,10 +579,10 @@ public function clearEdition()
|
||||
* developers should rely on the protoreflect APIs for their client language.
|
||||
*
|
||||
* Generated from protobuf field <code>optional .google.protobuf.Edition edition = 14;</code>
|
||||
* @param int $var
|
||||
* @param int $var one of the values in {@see \Google\Protobuf\Internal\Edition}
|
||||
* @return $this
|
||||
*/
|
||||
public function setEdition($var)
|
||||
public function setEdition(int $var)
|
||||
{
|
||||
GPBUtil::checkEnum($var, \Google\Protobuf\Internal\Edition::class);
|
||||
$this->edition = $var;
|
||||
|
||||
@@ -52,7 +52,7 @@ public function getFile()
|
||||
* @param \Google\Protobuf\Internal\FileDescriptorProto[] $var
|
||||
* @return $this
|
||||
*/
|
||||
public function setFile($var)
|
||||
public function setFile(array|RepeatedField $var)
|
||||
{
|
||||
$arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Internal\FileDescriptorProto::class);
|
||||
$this->file = $arr;
|
||||
|
||||
@@ -43,7 +43,7 @@ class FileOptions extends \Google\Protobuf\Internal\Message
|
||||
* generated to contain the file's getDescriptor() method as well as any
|
||||
* top-level extensions defined in the file.
|
||||
*
|
||||
* Generated from protobuf field <code>optional bool java_multiple_files = 10 [default = false];</code>
|
||||
* Generated from protobuf field <code>optional bool java_multiple_files = 10 [default = false, feature_support = {</code>
|
||||
*/
|
||||
protected $java_multiple_files = null;
|
||||
/**
|
||||
@@ -324,9 +324,9 @@ public function clearJavaPackage()
|
||||
* @param string $var
|
||||
* @return $this
|
||||
*/
|
||||
public function setJavaPackage($var)
|
||||
public function setJavaPackage(string $var)
|
||||
{
|
||||
GPBUtil::checkString($var, True);
|
||||
GPBUtil::checkString($var, true);
|
||||
$this->java_package = $var;
|
||||
|
||||
return $this;
|
||||
@@ -368,9 +368,9 @@ public function clearJavaOuterClassname()
|
||||
* @param string $var
|
||||
* @return $this
|
||||
*/
|
||||
public function setJavaOuterClassname($var)
|
||||
public function setJavaOuterClassname(string $var)
|
||||
{
|
||||
GPBUtil::checkString($var, True);
|
||||
GPBUtil::checkString($var, true);
|
||||
$this->java_outer_classname = $var;
|
||||
|
||||
return $this;
|
||||
@@ -384,7 +384,7 @@ public function setJavaOuterClassname($var)
|
||||
* generated to contain the file's getDescriptor() method as well as any
|
||||
* top-level extensions defined in the file.
|
||||
*
|
||||
* Generated from protobuf field <code>optional bool java_multiple_files = 10 [default = false];</code>
|
||||
* Generated from protobuf field <code>optional bool java_multiple_files = 10 [default = false, feature_support = {</code>
|
||||
* @return bool
|
||||
*/
|
||||
public function getJavaMultipleFiles()
|
||||
@@ -410,13 +410,12 @@ public function clearJavaMultipleFiles()
|
||||
* generated to contain the file's getDescriptor() method as well as any
|
||||
* top-level extensions defined in the file.
|
||||
*
|
||||
* Generated from protobuf field <code>optional bool java_multiple_files = 10 [default = false];</code>
|
||||
* Generated from protobuf field <code>optional bool java_multiple_files = 10 [default = false, feature_support = {</code>
|
||||
* @param bool $var
|
||||
* @return $this
|
||||
*/
|
||||
public function setJavaMultipleFiles($var)
|
||||
public function setJavaMultipleFiles(bool $var)
|
||||
{
|
||||
GPBUtil::checkBool($var);
|
||||
$this->java_multiple_files = $var;
|
||||
|
||||
return $this;
|
||||
@@ -459,10 +458,9 @@ public function clearJavaGenerateEqualsAndHash()
|
||||
* @return $this
|
||||
* @deprecated
|
||||
*/
|
||||
public function setJavaGenerateEqualsAndHash($var)
|
||||
public function setJavaGenerateEqualsAndHash(bool $var)
|
||||
{
|
||||
@trigger_error('java_generate_equals_and_hash is deprecated.', E_USER_DEPRECATED);
|
||||
GPBUtil::checkBool($var);
|
||||
$this->java_generate_equals_and_hash = $var;
|
||||
|
||||
return $this;
|
||||
@@ -510,9 +508,8 @@ public function clearJavaStringCheckUtf8()
|
||||
* @param bool $var
|
||||
* @return $this
|
||||
*/
|
||||
public function setJavaStringCheckUtf8($var)
|
||||
public function setJavaStringCheckUtf8(bool $var)
|
||||
{
|
||||
GPBUtil::checkBool($var);
|
||||
$this->java_string_check_utf8 = $var;
|
||||
|
||||
return $this;
|
||||
@@ -520,11 +517,11 @@ public function setJavaStringCheckUtf8($var)
|
||||
|
||||
/**
|
||||
* Generated from protobuf field <code>optional .google.protobuf.FileOptions.OptimizeMode optimize_for = 9 [default = SPEED];</code>
|
||||
* @return int
|
||||
* @return int one of the values in {@see \Google\Protobuf\Internal\FileOptions\OptimizeMode}
|
||||
*/
|
||||
public function getOptimizeFor()
|
||||
{
|
||||
return isset($this->optimize_for) ? $this->optimize_for : 0;
|
||||
return isset($this->optimize_for) ? $this->optimize_for : 1;
|
||||
}
|
||||
|
||||
public function hasOptimizeFor()
|
||||
@@ -539,10 +536,10 @@ public function clearOptimizeFor()
|
||||
|
||||
/**
|
||||
* Generated from protobuf field <code>optional .google.protobuf.FileOptions.OptimizeMode optimize_for = 9 [default = SPEED];</code>
|
||||
* @param int $var
|
||||
* @param int $var one of the values in {@see \Google\Protobuf\Internal\FileOptions\OptimizeMode}
|
||||
* @return $this
|
||||
*/
|
||||
public function setOptimizeFor($var)
|
||||
public function setOptimizeFor(int $var)
|
||||
{
|
||||
GPBUtil::checkEnum($var, \Google\Protobuf\Internal\FileOptions\OptimizeMode::class);
|
||||
$this->optimize_for = $var;
|
||||
@@ -586,9 +583,9 @@ public function clearGoPackage()
|
||||
* @param string $var
|
||||
* @return $this
|
||||
*/
|
||||
public function setGoPackage($var)
|
||||
public function setGoPackage(string $var)
|
||||
{
|
||||
GPBUtil::checkString($var, True);
|
||||
GPBUtil::checkString($var, true);
|
||||
$this->go_package = $var;
|
||||
|
||||
return $this;
|
||||
@@ -638,9 +635,8 @@ public function clearCcGenericServices()
|
||||
* @param bool $var
|
||||
* @return $this
|
||||
*/
|
||||
public function setCcGenericServices($var)
|
||||
public function setCcGenericServices(bool $var)
|
||||
{
|
||||
GPBUtil::checkBool($var);
|
||||
$this->cc_generic_services = $var;
|
||||
|
||||
return $this;
|
||||
@@ -670,9 +666,8 @@ public function clearJavaGenericServices()
|
||||
* @param bool $var
|
||||
* @return $this
|
||||
*/
|
||||
public function setJavaGenericServices($var)
|
||||
public function setJavaGenericServices(bool $var)
|
||||
{
|
||||
GPBUtil::checkBool($var);
|
||||
$this->java_generic_services = $var;
|
||||
|
||||
return $this;
|
||||
@@ -702,9 +697,8 @@ public function clearPyGenericServices()
|
||||
* @param bool $var
|
||||
* @return $this
|
||||
*/
|
||||
public function setPyGenericServices($var)
|
||||
public function setPyGenericServices(bool $var)
|
||||
{
|
||||
GPBUtil::checkBool($var);
|
||||
$this->py_generic_services = $var;
|
||||
|
||||
return $this;
|
||||
@@ -744,9 +738,8 @@ public function clearDeprecated()
|
||||
* @param bool $var
|
||||
* @return $this
|
||||
*/
|
||||
public function setDeprecated($var)
|
||||
public function setDeprecated(bool $var)
|
||||
{
|
||||
GPBUtil::checkBool($var);
|
||||
$this->deprecated = $var;
|
||||
|
||||
return $this;
|
||||
@@ -761,7 +754,7 @@ public function setDeprecated($var)
|
||||
*/
|
||||
public function getCcEnableArenas()
|
||||
{
|
||||
return isset($this->cc_enable_arenas) ? $this->cc_enable_arenas : false;
|
||||
return isset($this->cc_enable_arenas) ? $this->cc_enable_arenas : true;
|
||||
}
|
||||
|
||||
public function hasCcEnableArenas()
|
||||
@@ -782,9 +775,8 @@ public function clearCcEnableArenas()
|
||||
* @param bool $var
|
||||
* @return $this
|
||||
*/
|
||||
public function setCcEnableArenas($var)
|
||||
public function setCcEnableArenas(bool $var)
|
||||
{
|
||||
GPBUtil::checkBool($var);
|
||||
$this->cc_enable_arenas = $var;
|
||||
|
||||
return $this;
|
||||
@@ -820,9 +812,9 @@ public function clearObjcClassPrefix()
|
||||
* @param string $var
|
||||
* @return $this
|
||||
*/
|
||||
public function setObjcClassPrefix($var)
|
||||
public function setObjcClassPrefix(string $var)
|
||||
{
|
||||
GPBUtil::checkString($var, True);
|
||||
GPBUtil::checkString($var, true);
|
||||
$this->objc_class_prefix = $var;
|
||||
|
||||
return $this;
|
||||
@@ -856,9 +848,9 @@ public function clearCsharpNamespace()
|
||||
* @param string $var
|
||||
* @return $this
|
||||
*/
|
||||
public function setCsharpNamespace($var)
|
||||
public function setCsharpNamespace(string $var)
|
||||
{
|
||||
GPBUtil::checkString($var, True);
|
||||
GPBUtil::checkString($var, true);
|
||||
$this->csharp_namespace = $var;
|
||||
|
||||
return $this;
|
||||
@@ -898,9 +890,9 @@ public function clearSwiftPrefix()
|
||||
* @param string $var
|
||||
* @return $this
|
||||
*/
|
||||
public function setSwiftPrefix($var)
|
||||
public function setSwiftPrefix(string $var)
|
||||
{
|
||||
GPBUtil::checkString($var, True);
|
||||
GPBUtil::checkString($var, true);
|
||||
$this->swift_prefix = $var;
|
||||
|
||||
return $this;
|
||||
@@ -936,9 +928,9 @@ public function clearPhpClassPrefix()
|
||||
* @param string $var
|
||||
* @return $this
|
||||
*/
|
||||
public function setPhpClassPrefix($var)
|
||||
public function setPhpClassPrefix(string $var)
|
||||
{
|
||||
GPBUtil::checkString($var, True);
|
||||
GPBUtil::checkString($var, true);
|
||||
$this->php_class_prefix = $var;
|
||||
|
||||
return $this;
|
||||
@@ -976,9 +968,9 @@ public function clearPhpNamespace()
|
||||
* @param string $var
|
||||
* @return $this
|
||||
*/
|
||||
public function setPhpNamespace($var)
|
||||
public function setPhpNamespace(string $var)
|
||||
{
|
||||
GPBUtil::checkString($var, True);
|
||||
GPBUtil::checkString($var, true);
|
||||
$this->php_namespace = $var;
|
||||
|
||||
return $this;
|
||||
@@ -1016,9 +1008,9 @@ public function clearPhpMetadataNamespace()
|
||||
* @param string $var
|
||||
* @return $this
|
||||
*/
|
||||
public function setPhpMetadataNamespace($var)
|
||||
public function setPhpMetadataNamespace(string $var)
|
||||
{
|
||||
GPBUtil::checkString($var, True);
|
||||
GPBUtil::checkString($var, true);
|
||||
$this->php_metadata_namespace = $var;
|
||||
|
||||
return $this;
|
||||
@@ -1056,9 +1048,9 @@ public function clearRubyPackage()
|
||||
* @param string $var
|
||||
* @return $this
|
||||
*/
|
||||
public function setRubyPackage($var)
|
||||
public function setRubyPackage(string $var)
|
||||
{
|
||||
GPBUtil::checkString($var, True);
|
||||
GPBUtil::checkString($var, true);
|
||||
$this->ruby_package = $var;
|
||||
|
||||
return $this;
|
||||
@@ -1098,9 +1090,8 @@ public function clearFeatures()
|
||||
* @param \Google\Protobuf\Internal\FeatureSet $var
|
||||
* @return $this
|
||||
*/
|
||||
public function setFeatures($var)
|
||||
public function setFeatures(\Google\Protobuf\Internal\FeatureSet|null $var)
|
||||
{
|
||||
GPBUtil::checkMessage($var, \Google\Protobuf\Internal\FeatureSet::class);
|
||||
$this->features = $var;
|
||||
|
||||
return $this;
|
||||
@@ -1126,7 +1117,7 @@ public function getUninterpretedOption()
|
||||
* @param \Google\Protobuf\Internal\UninterpretedOption[] $var
|
||||
* @return $this
|
||||
*/
|
||||
public function setUninterpretedOption($var)
|
||||
public function setUninterpretedOption(array|RepeatedField $var)
|
||||
{
|
||||
$arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Internal\UninterpretedOption::class);
|
||||
$this->uninterpreted_option = $arr;
|
||||
|
||||
@@ -641,4 +641,9 @@ public static function hasJsonValue($msg)
|
||||
is_a($msg, "Google\Protobuf\StringValue") ||
|
||||
is_a($msg, "Google\Protobuf\BytesValue");
|
||||
}
|
||||
|
||||
public static function compatibleInt64($int64, $stringInt64)
|
||||
{
|
||||
return PHP_INT_SIZE === 4 ? $stringInt64 : $int64;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -64,7 +64,7 @@ public function getAnnotation()
|
||||
* @param \Google\Protobuf\Internal\GeneratedCodeInfo\Annotation[] $var
|
||||
* @return $this
|
||||
*/
|
||||
public function setAnnotation($var)
|
||||
public function setAnnotation(array|RepeatedField $var)
|
||||
{
|
||||
$arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Internal\GeneratedCodeInfo\Annotation::class);
|
||||
$this->annotation = $arr;
|
||||
|
||||
@@ -95,7 +95,7 @@ public function getPath()
|
||||
* @param int[] $var
|
||||
* @return $this
|
||||
*/
|
||||
public function setPath($var)
|
||||
public function setPath(array|RepeatedField $var)
|
||||
{
|
||||
$arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::INT32);
|
||||
$this->path = $arr;
|
||||
@@ -131,9 +131,9 @@ public function clearSourceFile()
|
||||
* @param string $var
|
||||
* @return $this
|
||||
*/
|
||||
public function setSourceFile($var)
|
||||
public function setSourceFile(string $var)
|
||||
{
|
||||
GPBUtil::checkString($var, True);
|
||||
GPBUtil::checkString($var, true);
|
||||
$this->source_file = $var;
|
||||
|
||||
return $this;
|
||||
@@ -169,7 +169,7 @@ public function clearBegin()
|
||||
* @param int $var
|
||||
* @return $this
|
||||
*/
|
||||
public function setBegin($var)
|
||||
public function setBegin(int $var)
|
||||
{
|
||||
GPBUtil::checkInt32($var);
|
||||
$this->begin = $var;
|
||||
@@ -209,7 +209,7 @@ public function clearEnd()
|
||||
* @param int $var
|
||||
* @return $this
|
||||
*/
|
||||
public function setEnd($var)
|
||||
public function setEnd(int $var)
|
||||
{
|
||||
GPBUtil::checkInt32($var);
|
||||
$this->end = $var;
|
||||
@@ -219,7 +219,7 @@ public function setEnd($var)
|
||||
|
||||
/**
|
||||
* Generated from protobuf field <code>optional .google.protobuf.GeneratedCodeInfo.Annotation.Semantic semantic = 5;</code>
|
||||
* @return int
|
||||
* @return int one of the values in {@see \Google\Protobuf\Internal\GeneratedCodeInfo\Annotation\Semantic}
|
||||
*/
|
||||
public function getSemantic()
|
||||
{
|
||||
@@ -238,10 +238,10 @@ public function clearSemantic()
|
||||
|
||||
/**
|
||||
* Generated from protobuf field <code>optional .google.protobuf.GeneratedCodeInfo.Annotation.Semantic semantic = 5;</code>
|
||||
* @param int $var
|
||||
* @param int $var one of the values in {@see \Google\Protobuf\Internal\GeneratedCodeInfo\Annotation\Semantic}
|
||||
* @return $this
|
||||
*/
|
||||
public function setSemantic($var)
|
||||
public function setSemantic(int $var)
|
||||
{
|
||||
GPBUtil::checkEnum($var, \Google\Protobuf\Internal\GeneratedCodeInfo\Annotation\Semantic::class);
|
||||
$this->semantic = $var;
|
||||
|
||||
@@ -77,6 +77,7 @@ private function initWithGeneratedPool()
|
||||
}
|
||||
foreach ($this->desc->getField() as $field) {
|
||||
$setter = $field->getSetter();
|
||||
$getter = $field->getGetter();
|
||||
if ($field->isMap()) {
|
||||
$message_type = $field->getMessageType();
|
||||
$key_field = $message_type->getFieldByNumber(1);
|
||||
@@ -129,7 +130,7 @@ private function initWithGeneratedPool()
|
||||
$oneof_name = $oneof->getName();
|
||||
$this->$oneof_name = new OneofField($oneof);
|
||||
} else if (!$field->isRequired() && !$field->isRepeated() &&
|
||||
PHP_INT_SIZE == 4) {
|
||||
PHP_INT_SIZE == 4 && $this->$getter() === 0) {
|
||||
switch ($field->getType()) {
|
||||
case GPBType::INT64:
|
||||
case GPBType::UINT64:
|
||||
@@ -239,6 +240,14 @@ protected function whichOneof($oneof_name)
|
||||
return $field->getName();
|
||||
}
|
||||
|
||||
/**
|
||||
* @ignore
|
||||
*/
|
||||
private function shouldEmitDefaults($options): bool
|
||||
{
|
||||
return ($options & \Google\Protobuf\PrintOptions::EMIT_DEFAULTS) !== 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* @ignore
|
||||
*/
|
||||
@@ -1469,6 +1478,7 @@ public function serializeToStream(&$output)
|
||||
*/
|
||||
public function serializeToJsonStream(&$output)
|
||||
{
|
||||
$options = $output->getOptions();
|
||||
if (is_a($this, 'Google\Protobuf\Any')) {
|
||||
$output->writeRaw("{", 1);
|
||||
$type_field = $this->desc->getFieldByNumber(1);
|
||||
@@ -1487,7 +1497,7 @@ public function serializeToJsonStream(&$output)
|
||||
} else {
|
||||
$value_fields = $value_msg->desc->getField();
|
||||
foreach ($value_fields as $field) {
|
||||
if ($value_msg->existField($field)) {
|
||||
if ($value_msg->existField($field, $options)) {
|
||||
$output->writeRaw(",", 1);
|
||||
if (!$value_msg->serializeFieldToJsonStream($output, $field)) {
|
||||
return false;
|
||||
@@ -1513,7 +1523,7 @@ public function serializeToJsonStream(&$output)
|
||||
$output->writeRaw($timestamp, strlen($timestamp));
|
||||
} elseif (get_class($this) === 'Google\Protobuf\ListValue') {
|
||||
$field = $this->desc->getField()[1];
|
||||
if (!$this->existField($field)) {
|
||||
if (!$this->existField($field, $options)) {
|
||||
$output->writeRaw("[]", 2);
|
||||
} else {
|
||||
if (!$this->serializeFieldToJsonStream($output, $field)) {
|
||||
@@ -1522,7 +1532,7 @@ public function serializeToJsonStream(&$output)
|
||||
}
|
||||
} elseif (get_class($this) === 'Google\Protobuf\Struct') {
|
||||
$field = $this->desc->getField()[1];
|
||||
if (!$this->existField($field)) {
|
||||
if (!$this->existField($field, $options)) {
|
||||
$output->writeRaw("{}", 2);
|
||||
} else {
|
||||
if (!$this->serializeFieldToJsonStream($output, $field)) {
|
||||
@@ -1536,7 +1546,7 @@ public function serializeToJsonStream(&$output)
|
||||
$fields = $this->desc->getField();
|
||||
$first = true;
|
||||
foreach ($fields as $field) {
|
||||
if ($this->existField($field) ||
|
||||
if ($this->existField($field, $options) ||
|
||||
GPBUtil::hasJsonValue($this)) {
|
||||
if ($first) {
|
||||
$first = false;
|
||||
@@ -1580,7 +1590,7 @@ public function serializeToJsonString($options = 0)
|
||||
/**
|
||||
* @ignore
|
||||
*/
|
||||
private function existField($field)
|
||||
private function existField($field, $options = 0)
|
||||
{
|
||||
$getter = $field->getGetter();
|
||||
$hazzer = "has" . substr($getter, 3);
|
||||
@@ -1597,10 +1607,19 @@ private function existField($field)
|
||||
|
||||
$values = $this->$getter();
|
||||
if ($field->isMap()) {
|
||||
if ($this->shouldEmitDefaults($options)) {
|
||||
return true;
|
||||
}
|
||||
return count($values) !== 0;
|
||||
} elseif ($field->isRepeated()) {
|
||||
if ($this->shouldEmitDefaults($options)) {
|
||||
return true;
|
||||
}
|
||||
return count($values) !== 0;
|
||||
} else {
|
||||
if ($this->shouldEmitDefaults($options)) {
|
||||
return true;
|
||||
}
|
||||
return $values !== $this->defaultValue($field);
|
||||
}
|
||||
}
|
||||
@@ -1863,7 +1882,7 @@ private function fieldJsonByteSize($field, $options = 0)
|
||||
$getter = $field->getGetter();
|
||||
$values = $this->$getter();
|
||||
$count = count($values);
|
||||
if ($count !== 0) {
|
||||
if ($count !== 0 || $this->shouldEmitDefaults($options)) {
|
||||
if (!GPBUtil::hasSpecialJsonMapping($this)) {
|
||||
$size += 3; // size for "\"\":".
|
||||
if ($options & PrintOptions::PRESERVE_PROTO_FIELD_NAMES) {
|
||||
@@ -1873,37 +1892,39 @@ private function fieldJsonByteSize($field, $options = 0)
|
||||
} // size for field name
|
||||
}
|
||||
$size += 2; // size for "{}".
|
||||
$size += $count - 1; // size for commas
|
||||
$getter = $field->getGetter();
|
||||
$map_entry = $field->getMessageType();
|
||||
$key_field = $map_entry->getFieldByNumber(1);
|
||||
$value_field = $map_entry->getFieldByNumber(2);
|
||||
switch ($key_field->getType()) {
|
||||
case GPBType::STRING:
|
||||
case GPBType::SFIXED64:
|
||||
case GPBType::INT64:
|
||||
case GPBType::SINT64:
|
||||
case GPBType::FIXED64:
|
||||
case GPBType::UINT64:
|
||||
$additional_quote = false;
|
||||
break;
|
||||
default:
|
||||
$additional_quote = true;
|
||||
}
|
||||
foreach ($values as $key => $value) {
|
||||
if ($additional_quote) {
|
||||
$size += 2; // size for ""
|
||||
if ($count > 0) {
|
||||
$size += $count - 1; // size for commas
|
||||
$getter = $field->getGetter();
|
||||
$map_entry = $field->getMessageType();
|
||||
$key_field = $map_entry->getFieldByNumber(1);
|
||||
$value_field = $map_entry->getFieldByNumber(2);
|
||||
switch ($key_field->getType()) {
|
||||
case GPBType::STRING:
|
||||
case GPBType::SFIXED64:
|
||||
case GPBType::INT64:
|
||||
case GPBType::SINT64:
|
||||
case GPBType::FIXED64:
|
||||
case GPBType::UINT64:
|
||||
$additional_quote = false;
|
||||
break;
|
||||
default:
|
||||
$additional_quote = true;
|
||||
}
|
||||
foreach ($values as $key => $value) {
|
||||
if ($additional_quote) {
|
||||
$size += 2; // size for ""
|
||||
}
|
||||
$size += $this->fieldDataOnlyJsonByteSize($key_field, $key, $options);
|
||||
$size += $this->fieldDataOnlyJsonByteSize($value_field, $value, $options);
|
||||
$size += 1; // size for :
|
||||
}
|
||||
$size += $this->fieldDataOnlyJsonByteSize($key_field, $key, $options);
|
||||
$size += $this->fieldDataOnlyJsonByteSize($value_field, $value, $options);
|
||||
$size += 1; // size for :
|
||||
}
|
||||
}
|
||||
} elseif ($field->isRepeated()) {
|
||||
$getter = $field->getGetter();
|
||||
$values = $this->$getter();
|
||||
$count = count($values);
|
||||
if ($count !== 0) {
|
||||
if ($count !== 0 || $this->shouldEmitDefaults($options)) {
|
||||
if (!GPBUtil::hasSpecialJsonMapping($this)) {
|
||||
$size += 3; // size for "\"\":".
|
||||
if ($options & PrintOptions::PRESERVE_PROTO_FIELD_NAMES) {
|
||||
@@ -1913,13 +1934,15 @@ private function fieldJsonByteSize($field, $options = 0)
|
||||
} // size for field name
|
||||
}
|
||||
$size += 2; // size for "[]".
|
||||
$size += $count - 1; // size for commas
|
||||
$getter = $field->getGetter();
|
||||
foreach ($values as $value) {
|
||||
$size += $this->fieldDataOnlyJsonByteSize($field, $value, $options);
|
||||
if ($count > 0) {
|
||||
$size += $count - 1; // size for commas
|
||||
$getter = $field->getGetter();
|
||||
foreach ($values as $value) {
|
||||
$size += $this->fieldDataOnlyJsonByteSize($field, $value, $options);
|
||||
}
|
||||
}
|
||||
}
|
||||
} elseif ($this->existField($field) || GPBUtil::hasJsonValue($this)) {
|
||||
} elseif ($this->existField($field, $options) || GPBUtil::hasJsonValue($this)) {
|
||||
if (!GPBUtil::hasSpecialJsonMapping($this)) {
|
||||
$size += 3; // size for "\"\":".
|
||||
if ($options & PrintOptions::PRESERVE_PROTO_FIELD_NAMES) {
|
||||
@@ -2017,7 +2040,7 @@ public function jsonByteSize($options = 0)
|
||||
$size += strlen($timestamp);
|
||||
} elseif (get_class($this) === 'Google\Protobuf\ListValue') {
|
||||
$field = $this->desc->getField()[1];
|
||||
if ($this->existField($field)) {
|
||||
if ($this->existField($field, $options)) {
|
||||
$field_size = $this->fieldJsonByteSize($field, $options);
|
||||
$size += $field_size;
|
||||
} else {
|
||||
@@ -2026,7 +2049,7 @@ public function jsonByteSize($options = 0)
|
||||
}
|
||||
} elseif (get_class($this) === 'Google\Protobuf\Struct') {
|
||||
$field = $this->desc->getField()[1];
|
||||
if ($this->existField($field)) {
|
||||
if ($this->existField($field, $options)) {
|
||||
$field_size = $this->fieldJsonByteSize($field, $options);
|
||||
$size += $field_size;
|
||||
} else {
|
||||
|
||||
@@ -235,9 +235,8 @@ public function clearMessageSetWireFormat()
|
||||
* @param bool $var
|
||||
* @return $this
|
||||
*/
|
||||
public function setMessageSetWireFormat($var)
|
||||
public function setMessageSetWireFormat(bool $var)
|
||||
{
|
||||
GPBUtil::checkBool($var);
|
||||
$this->message_set_wire_format = $var;
|
||||
|
||||
return $this;
|
||||
@@ -275,9 +274,8 @@ public function clearNoStandardDescriptorAccessor()
|
||||
* @param bool $var
|
||||
* @return $this
|
||||
*/
|
||||
public function setNoStandardDescriptorAccessor($var)
|
||||
public function setNoStandardDescriptorAccessor(bool $var)
|
||||
{
|
||||
GPBUtil::checkBool($var);
|
||||
$this->no_standard_descriptor_accessor = $var;
|
||||
|
||||
return $this;
|
||||
@@ -317,9 +315,8 @@ public function clearDeprecated()
|
||||
* @param bool $var
|
||||
* @return $this
|
||||
*/
|
||||
public function setDeprecated($var)
|
||||
public function setDeprecated(bool $var)
|
||||
{
|
||||
GPBUtil::checkBool($var);
|
||||
$this->deprecated = $var;
|
||||
|
||||
return $this;
|
||||
@@ -387,9 +384,8 @@ public function clearMapEntry()
|
||||
* @param bool $var
|
||||
* @return $this
|
||||
*/
|
||||
public function setMapEntry($var)
|
||||
public function setMapEntry(bool $var)
|
||||
{
|
||||
GPBUtil::checkBool($var);
|
||||
$this->map_entry = $var;
|
||||
|
||||
return $this;
|
||||
@@ -446,10 +442,9 @@ public function clearDeprecatedLegacyJsonFieldConflicts()
|
||||
* @return $this
|
||||
* @deprecated
|
||||
*/
|
||||
public function setDeprecatedLegacyJsonFieldConflicts($var)
|
||||
public function setDeprecatedLegacyJsonFieldConflicts(bool $var)
|
||||
{
|
||||
@trigger_error('deprecated_legacy_json_field_conflicts is deprecated.', E_USER_DEPRECATED);
|
||||
GPBUtil::checkBool($var);
|
||||
$this->deprecated_legacy_json_field_conflicts = $var;
|
||||
|
||||
return $this;
|
||||
@@ -489,9 +484,8 @@ public function clearFeatures()
|
||||
* @param \Google\Protobuf\Internal\FeatureSet $var
|
||||
* @return $this
|
||||
*/
|
||||
public function setFeatures($var)
|
||||
public function setFeatures(\Google\Protobuf\Internal\FeatureSet|null $var)
|
||||
{
|
||||
GPBUtil::checkMessage($var, \Google\Protobuf\Internal\FeatureSet::class);
|
||||
$this->features = $var;
|
||||
|
||||
return $this;
|
||||
@@ -515,7 +509,7 @@ public function getUninterpretedOption()
|
||||
* @param \Google\Protobuf\Internal\UninterpretedOption[] $var
|
||||
* @return $this
|
||||
*/
|
||||
public function setUninterpretedOption($var)
|
||||
public function setUninterpretedOption(array|RepeatedField $var)
|
||||
{
|
||||
$arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Internal\UninterpretedOption::class);
|
||||
$this->uninterpreted_option = $arr;
|
||||
|
||||
@@ -97,9 +97,9 @@ public function clearName()
|
||||
* @param string $var
|
||||
* @return $this
|
||||
*/
|
||||
public function setName($var)
|
||||
public function setName(string $var)
|
||||
{
|
||||
GPBUtil::checkString($var, True);
|
||||
GPBUtil::checkString($var, true);
|
||||
$this->name = $var;
|
||||
|
||||
return $this;
|
||||
@@ -135,9 +135,9 @@ public function clearInputType()
|
||||
* @param string $var
|
||||
* @return $this
|
||||
*/
|
||||
public function setInputType($var)
|
||||
public function setInputType(string $var)
|
||||
{
|
||||
GPBUtil::checkString($var, True);
|
||||
GPBUtil::checkString($var, true);
|
||||
$this->input_type = $var;
|
||||
|
||||
return $this;
|
||||
@@ -167,9 +167,9 @@ public function clearOutputType()
|
||||
* @param string $var
|
||||
* @return $this
|
||||
*/
|
||||
public function setOutputType($var)
|
||||
public function setOutputType(string $var)
|
||||
{
|
||||
GPBUtil::checkString($var, True);
|
||||
GPBUtil::checkString($var, true);
|
||||
$this->output_type = $var;
|
||||
|
||||
return $this;
|
||||
@@ -199,9 +199,8 @@ public function clearOptions()
|
||||
* @param \Google\Protobuf\Internal\MethodOptions $var
|
||||
* @return $this
|
||||
*/
|
||||
public function setOptions($var)
|
||||
public function setOptions(\Google\Protobuf\Internal\MethodOptions|null $var)
|
||||
{
|
||||
GPBUtil::checkMessage($var, \Google\Protobuf\Internal\MethodOptions::class);
|
||||
$this->options = $var;
|
||||
|
||||
return $this;
|
||||
@@ -235,9 +234,8 @@ public function clearClientStreaming()
|
||||
* @param bool $var
|
||||
* @return $this
|
||||
*/
|
||||
public function setClientStreaming($var)
|
||||
public function setClientStreaming(bool $var)
|
||||
{
|
||||
GPBUtil::checkBool($var);
|
||||
$this->client_streaming = $var;
|
||||
|
||||
return $this;
|
||||
@@ -271,9 +269,8 @@ public function clearServerStreaming()
|
||||
* @param bool $var
|
||||
* @return $this
|
||||
*/
|
||||
public function setServerStreaming($var)
|
||||
public function setServerStreaming(bool $var)
|
||||
{
|
||||
GPBUtil::checkBool($var);
|
||||
$this->server_streaming = $var;
|
||||
|
||||
return $this;
|
||||
|
||||
@@ -105,9 +105,8 @@ public function clearDeprecated()
|
||||
* @param bool $var
|
||||
* @return $this
|
||||
*/
|
||||
public function setDeprecated($var)
|
||||
public function setDeprecated(bool $var)
|
||||
{
|
||||
GPBUtil::checkBool($var);
|
||||
$this->deprecated = $var;
|
||||
|
||||
return $this;
|
||||
@@ -115,7 +114,7 @@ public function setDeprecated($var)
|
||||
|
||||
/**
|
||||
* Generated from protobuf field <code>optional .google.protobuf.MethodOptions.IdempotencyLevel idempotency_level = 34 [default = IDEMPOTENCY_UNKNOWN];</code>
|
||||
* @return int
|
||||
* @return int one of the values in {@see \Google\Protobuf\Internal\MethodOptions\IdempotencyLevel}
|
||||
*/
|
||||
public function getIdempotencyLevel()
|
||||
{
|
||||
@@ -134,10 +133,10 @@ public function clearIdempotencyLevel()
|
||||
|
||||
/**
|
||||
* Generated from protobuf field <code>optional .google.protobuf.MethodOptions.IdempotencyLevel idempotency_level = 34 [default = IDEMPOTENCY_UNKNOWN];</code>
|
||||
* @param int $var
|
||||
* @param int $var one of the values in {@see \Google\Protobuf\Internal\MethodOptions\IdempotencyLevel}
|
||||
* @return $this
|
||||
*/
|
||||
public function setIdempotencyLevel($var)
|
||||
public function setIdempotencyLevel(int $var)
|
||||
{
|
||||
GPBUtil::checkEnum($var, \Google\Protobuf\Internal\MethodOptions\IdempotencyLevel::class);
|
||||
$this->idempotency_level = $var;
|
||||
@@ -179,9 +178,8 @@ public function clearFeatures()
|
||||
* @param \Google\Protobuf\Internal\FeatureSet $var
|
||||
* @return $this
|
||||
*/
|
||||
public function setFeatures($var)
|
||||
public function setFeatures(\Google\Protobuf\Internal\FeatureSet|null $var)
|
||||
{
|
||||
GPBUtil::checkMessage($var, \Google\Protobuf\Internal\FeatureSet::class);
|
||||
$this->features = $var;
|
||||
|
||||
return $this;
|
||||
@@ -205,7 +203,7 @@ public function getUninterpretedOption()
|
||||
* @param \Google\Protobuf\Internal\UninterpretedOption[] $var
|
||||
* @return $this
|
||||
*/
|
||||
public function setUninterpretedOption($var)
|
||||
public function setUninterpretedOption(array|RepeatedField $var)
|
||||
{
|
||||
$arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Internal\UninterpretedOption::class);
|
||||
$this->uninterpreted_option = $arr;
|
||||
|
||||
@@ -66,9 +66,9 @@ public function clearName()
|
||||
* @param string $var
|
||||
* @return $this
|
||||
*/
|
||||
public function setName($var)
|
||||
public function setName(string $var)
|
||||
{
|
||||
GPBUtil::checkString($var, True);
|
||||
GPBUtil::checkString($var, true);
|
||||
$this->name = $var;
|
||||
|
||||
return $this;
|
||||
@@ -98,9 +98,8 @@ public function clearOptions()
|
||||
* @param \Google\Protobuf\Internal\OneofOptions $var
|
||||
* @return $this
|
||||
*/
|
||||
public function setOptions($var)
|
||||
public function setOptions(\Google\Protobuf\Internal\OneofOptions|null $var)
|
||||
{
|
||||
GPBUtil::checkMessage($var, \Google\Protobuf\Internal\OneofOptions::class);
|
||||
$this->options = $var;
|
||||
|
||||
return $this;
|
||||
|
||||
@@ -86,9 +86,8 @@ public function clearFeatures()
|
||||
* @param \Google\Protobuf\Internal\FeatureSet $var
|
||||
* @return $this
|
||||
*/
|
||||
public function setFeatures($var)
|
||||
public function setFeatures(\Google\Protobuf\Internal\FeatureSet|null $var)
|
||||
{
|
||||
GPBUtil::checkMessage($var, \Google\Protobuf\Internal\FeatureSet::class);
|
||||
$this->features = $var;
|
||||
|
||||
return $this;
|
||||
@@ -112,7 +111,7 @@ public function getUninterpretedOption()
|
||||
* @param \Google\Protobuf\Internal\UninterpretedOption[] $var
|
||||
* @return $this
|
||||
*/
|
||||
public function setUninterpretedOption($var)
|
||||
public function setUninterpretedOption(array|RepeatedField $var)
|
||||
{
|
||||
$arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Internal\UninterpretedOption::class);
|
||||
$this->uninterpreted_option = $arr;
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace Google\Protobuf\Internal;
|
||||
|
||||
if (false) {
|
||||
/**
|
||||
* This class is deprecated. Use Google\Protobuf\RepeatedField instead.
|
||||
* @deprecated
|
||||
*/
|
||||
class RepeatedField extends \Google\Protobuf\RepeatedField {}
|
||||
}
|
||||
class_exists(\Google\Protobuf\RepeatedField::class);
|
||||
@trigger_error('Google\Protobuf\Internal\RepeatedField is deprecated and will be removed in the next major release. Use Google\Protobuf\RepeatedField instead', E_USER_DEPRECATED);
|
||||
@@ -71,9 +71,9 @@ public function clearName()
|
||||
* @param string $var
|
||||
* @return $this
|
||||
*/
|
||||
public function setName($var)
|
||||
public function setName(string $var)
|
||||
{
|
||||
GPBUtil::checkString($var, True);
|
||||
GPBUtil::checkString($var, true);
|
||||
$this->name = $var;
|
||||
|
||||
return $this;
|
||||
@@ -93,7 +93,7 @@ public function getMethod()
|
||||
* @param \Google\Protobuf\Internal\MethodDescriptorProto[] $var
|
||||
* @return $this
|
||||
*/
|
||||
public function setMethod($var)
|
||||
public function setMethod(array|RepeatedField $var)
|
||||
{
|
||||
$arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Internal\MethodDescriptorProto::class);
|
||||
$this->method = $arr;
|
||||
@@ -125,9 +125,8 @@ public function clearOptions()
|
||||
* @param \Google\Protobuf\Internal\ServiceOptions $var
|
||||
* @return $this
|
||||
*/
|
||||
public function setOptions($var)
|
||||
public function setOptions(\Google\Protobuf\Internal\ServiceOptions|null $var)
|
||||
{
|
||||
GPBUtil::checkMessage($var, \Google\Protobuf\Internal\ServiceOptions::class);
|
||||
$this->options = $var;
|
||||
|
||||
return $this;
|
||||
|
||||
@@ -100,9 +100,8 @@ public function clearFeatures()
|
||||
* @param \Google\Protobuf\Internal\FeatureSet $var
|
||||
* @return $this
|
||||
*/
|
||||
public function setFeatures($var)
|
||||
public function setFeatures(\Google\Protobuf\Internal\FeatureSet|null $var)
|
||||
{
|
||||
GPBUtil::checkMessage($var, \Google\Protobuf\Internal\FeatureSet::class);
|
||||
$this->features = $var;
|
||||
|
||||
return $this;
|
||||
@@ -142,9 +141,8 @@ public function clearDeprecated()
|
||||
* @param bool $var
|
||||
* @return $this
|
||||
*/
|
||||
public function setDeprecated($var)
|
||||
public function setDeprecated(bool $var)
|
||||
{
|
||||
GPBUtil::checkBool($var);
|
||||
$this->deprecated = $var;
|
||||
|
||||
return $this;
|
||||
@@ -168,7 +166,7 @@ public function getUninterpretedOption()
|
||||
* @param \Google\Protobuf\Internal\UninterpretedOption[] $var
|
||||
* @return $this
|
||||
*/
|
||||
public function setUninterpretedOption($var)
|
||||
public function setUninterpretedOption(array|RepeatedField $var)
|
||||
{
|
||||
$arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Internal\UninterpretedOption::class);
|
||||
$this->uninterpreted_option = $arr;
|
||||
|
||||
@@ -219,7 +219,7 @@ public function getLocation()
|
||||
* @param \Google\Protobuf\Internal\SourceCodeInfo\Location[] $var
|
||||
* @return $this
|
||||
*/
|
||||
public function setLocation($var)
|
||||
public function setLocation(array|RepeatedField $var)
|
||||
{
|
||||
$arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Internal\SourceCodeInfo\Location::class);
|
||||
$this->location = $arr;
|
||||
|
||||
@@ -240,7 +240,7 @@ public function getPath()
|
||||
* @param int[] $var
|
||||
* @return $this
|
||||
*/
|
||||
public function setPath($var)
|
||||
public function setPath(array|RepeatedField $var)
|
||||
{
|
||||
$arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::INT32);
|
||||
$this->path = $arr;
|
||||
@@ -274,7 +274,7 @@ public function getSpan()
|
||||
* @param int[] $var
|
||||
* @return $this
|
||||
*/
|
||||
public function setSpan($var)
|
||||
public function setSpan(array|RepeatedField $var)
|
||||
{
|
||||
$arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::INT32);
|
||||
$this->span = $arr;
|
||||
@@ -380,9 +380,9 @@ public function clearLeadingComments()
|
||||
* @param string $var
|
||||
* @return $this
|
||||
*/
|
||||
public function setLeadingComments($var)
|
||||
public function setLeadingComments(string $var)
|
||||
{
|
||||
GPBUtil::checkString($var, True);
|
||||
GPBUtil::checkString($var, true);
|
||||
$this->leading_comments = $var;
|
||||
|
||||
return $this;
|
||||
@@ -412,9 +412,9 @@ public function clearTrailingComments()
|
||||
* @param string $var
|
||||
* @return $this
|
||||
*/
|
||||
public function setTrailingComments($var)
|
||||
public function setTrailingComments(string $var)
|
||||
{
|
||||
GPBUtil::checkString($var, True);
|
||||
GPBUtil::checkString($var, true);
|
||||
$this->trailing_comments = $var;
|
||||
|
||||
return $this;
|
||||
@@ -434,7 +434,7 @@ public function getLeadingDetachedComments()
|
||||
* @param string[] $var
|
||||
* @return $this
|
||||
*/
|
||||
public function setLeadingDetachedComments($var)
|
||||
public function setLeadingDetachedComments(array|RepeatedField $var)
|
||||
{
|
||||
$arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING);
|
||||
$this->leading_detached_comments = $arr;
|
||||
|
||||
@@ -91,7 +91,7 @@ public function getName()
|
||||
* @param \Google\Protobuf\Internal\UninterpretedOption\NamePart[] $var
|
||||
* @return $this
|
||||
*/
|
||||
public function setName($var)
|
||||
public function setName(array|RepeatedField $var)
|
||||
{
|
||||
$arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Internal\UninterpretedOption\NamePart::class);
|
||||
$this->name = $arr;
|
||||
@@ -129,9 +129,9 @@ public function clearIdentifierValue()
|
||||
* @param string $var
|
||||
* @return $this
|
||||
*/
|
||||
public function setIdentifierValue($var)
|
||||
public function setIdentifierValue(string $var)
|
||||
{
|
||||
GPBUtil::checkString($var, True);
|
||||
GPBUtil::checkString($var, true);
|
||||
$this->identifier_value = $var;
|
||||
|
||||
return $this;
|
||||
@@ -143,7 +143,7 @@ public function setIdentifierValue($var)
|
||||
*/
|
||||
public function getPositiveIntValue()
|
||||
{
|
||||
return isset($this->positive_int_value) ? $this->positive_int_value : 0;
|
||||
return isset($this->positive_int_value) ? $this->positive_int_value : GPBUtil::compatibleInt64(0, '0');
|
||||
}
|
||||
|
||||
public function hasPositiveIntValue()
|
||||
@@ -161,7 +161,7 @@ public function clearPositiveIntValue()
|
||||
* @param int|string $var
|
||||
* @return $this
|
||||
*/
|
||||
public function setPositiveIntValue($var)
|
||||
public function setPositiveIntValue(int|string $var)
|
||||
{
|
||||
GPBUtil::checkUint64($var);
|
||||
$this->positive_int_value = $var;
|
||||
@@ -175,7 +175,7 @@ public function setPositiveIntValue($var)
|
||||
*/
|
||||
public function getNegativeIntValue()
|
||||
{
|
||||
return isset($this->negative_int_value) ? $this->negative_int_value : 0;
|
||||
return isset($this->negative_int_value) ? $this->negative_int_value : GPBUtil::compatibleInt64(0, '0');
|
||||
}
|
||||
|
||||
public function hasNegativeIntValue()
|
||||
@@ -193,7 +193,7 @@ public function clearNegativeIntValue()
|
||||
* @param int|string $var
|
||||
* @return $this
|
||||
*/
|
||||
public function setNegativeIntValue($var)
|
||||
public function setNegativeIntValue(int|string $var)
|
||||
{
|
||||
GPBUtil::checkInt64($var);
|
||||
$this->negative_int_value = $var;
|
||||
@@ -225,9 +225,8 @@ public function clearDoubleValue()
|
||||
* @param float $var
|
||||
* @return $this
|
||||
*/
|
||||
public function setDoubleValue($var)
|
||||
public function setDoubleValue(float $var)
|
||||
{
|
||||
GPBUtil::checkDouble($var);
|
||||
$this->double_value = $var;
|
||||
|
||||
return $this;
|
||||
@@ -257,9 +256,9 @@ public function clearStringValue()
|
||||
* @param string $var
|
||||
* @return $this
|
||||
*/
|
||||
public function setStringValue($var)
|
||||
public function setStringValue(string $var)
|
||||
{
|
||||
GPBUtil::checkString($var, False);
|
||||
GPBUtil::checkString($var, false);
|
||||
$this->string_value = $var;
|
||||
|
||||
return $this;
|
||||
@@ -289,9 +288,9 @@ public function clearAggregateValue()
|
||||
* @param string $var
|
||||
* @return $this
|
||||
*/
|
||||
public function setAggregateValue($var)
|
||||
public function setAggregateValue(string $var)
|
||||
{
|
||||
GPBUtil::checkString($var, True);
|
||||
GPBUtil::checkString($var, true);
|
||||
$this->aggregate_value = $var;
|
||||
|
||||
return $this;
|
||||
|
||||
@@ -70,9 +70,9 @@ public function clearNamePart()
|
||||
* @param string $var
|
||||
* @return $this
|
||||
*/
|
||||
public function setNamePart($var)
|
||||
public function setNamePart(string $var)
|
||||
{
|
||||
GPBUtil::checkString($var, True);
|
||||
GPBUtil::checkString($var, true);
|
||||
$this->name_part = $var;
|
||||
|
||||
return $this;
|
||||
@@ -102,9 +102,8 @@ public function clearIsExtension()
|
||||
* @param bool $var
|
||||
* @return $this
|
||||
*/
|
||||
public function setIsExtension($var)
|
||||
public function setIsExtension(bool $var)
|
||||
{
|
||||
GPBUtil::checkBool($var);
|
||||
$this->is_extension = $var;
|
||||
|
||||
return $this;
|
||||
|
||||
@@ -57,7 +57,7 @@ public function getValues()
|
||||
* @param \Google\Protobuf\Value[] $var
|
||||
* @return $this
|
||||
*/
|
||||
public function setValues($var)
|
||||
public function setValues(array|RepeatedField $var)
|
||||
{
|
||||
$arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Value::class);
|
||||
$this->values = $arr;
|
||||
|
||||
@@ -126,9 +126,9 @@ public function getName()
|
||||
* @param string $var
|
||||
* @return $this
|
||||
*/
|
||||
public function setName($var)
|
||||
public function setName(string $var)
|
||||
{
|
||||
GPBUtil::checkString($var, True);
|
||||
GPBUtil::checkString($var, true);
|
||||
$this->name = $var;
|
||||
|
||||
return $this;
|
||||
@@ -152,9 +152,9 @@ public function getRequestTypeUrl()
|
||||
* @param string $var
|
||||
* @return $this
|
||||
*/
|
||||
public function setRequestTypeUrl($var)
|
||||
public function setRequestTypeUrl(string $var)
|
||||
{
|
||||
GPBUtil::checkString($var, True);
|
||||
GPBUtil::checkString($var, true);
|
||||
$this->request_type_url = $var;
|
||||
|
||||
return $this;
|
||||
@@ -178,9 +178,8 @@ public function getRequestStreaming()
|
||||
* @param bool $var
|
||||
* @return $this
|
||||
*/
|
||||
public function setRequestStreaming($var)
|
||||
public function setRequestStreaming(bool $var)
|
||||
{
|
||||
GPBUtil::checkBool($var);
|
||||
$this->request_streaming = $var;
|
||||
|
||||
return $this;
|
||||
@@ -204,9 +203,9 @@ public function getResponseTypeUrl()
|
||||
* @param string $var
|
||||
* @return $this
|
||||
*/
|
||||
public function setResponseTypeUrl($var)
|
||||
public function setResponseTypeUrl(string $var)
|
||||
{
|
||||
GPBUtil::checkString($var, True);
|
||||
GPBUtil::checkString($var, true);
|
||||
$this->response_type_url = $var;
|
||||
|
||||
return $this;
|
||||
@@ -230,9 +229,8 @@ public function getResponseStreaming()
|
||||
* @param bool $var
|
||||
* @return $this
|
||||
*/
|
||||
public function setResponseStreaming($var)
|
||||
public function setResponseStreaming(bool $var)
|
||||
{
|
||||
GPBUtil::checkBool($var);
|
||||
$this->response_streaming = $var;
|
||||
|
||||
return $this;
|
||||
@@ -256,7 +254,7 @@ public function getOptions()
|
||||
* @param \Google\Protobuf\Option[] $var
|
||||
* @return $this
|
||||
*/
|
||||
public function setOptions($var)
|
||||
public function setOptions(array|RepeatedField $var)
|
||||
{
|
||||
$arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Option::class);
|
||||
$this->options = $arr;
|
||||
@@ -270,7 +268,7 @@ public function setOptions($var)
|
||||
* Api. This is similar to Field and EnumValue.
|
||||
*
|
||||
* Generated from protobuf field <code>.google.protobuf.Syntax syntax = 7 [deprecated = true];</code>
|
||||
* @return int
|
||||
* @return int one of the values in {@see \Google\Protobuf\Syntax}
|
||||
* @deprecated
|
||||
*/
|
||||
public function getSyntax()
|
||||
@@ -287,11 +285,11 @@ public function getSyntax()
|
||||
* Api. This is similar to Field and EnumValue.
|
||||
*
|
||||
* Generated from protobuf field <code>.google.protobuf.Syntax syntax = 7 [deprecated = true];</code>
|
||||
* @param int $var
|
||||
* @param int $var one of the values in {@see \Google\Protobuf\Syntax}
|
||||
* @return $this
|
||||
* @deprecated
|
||||
*/
|
||||
public function setSyntax($var)
|
||||
public function setSyntax(int $var)
|
||||
{
|
||||
@trigger_error('syntax is deprecated.', E_USER_DEPRECATED);
|
||||
GPBUtil::checkEnum($var, \Google\Protobuf\Syntax::class);
|
||||
@@ -327,10 +325,10 @@ public function getEdition()
|
||||
* @return $this
|
||||
* @deprecated
|
||||
*/
|
||||
public function setEdition($var)
|
||||
public function setEdition(string $var)
|
||||
{
|
||||
@trigger_error('edition is deprecated.', E_USER_DEPRECATED);
|
||||
GPBUtil::checkString($var, True);
|
||||
GPBUtil::checkString($var, true);
|
||||
$this->edition = $var;
|
||||
|
||||
return $this;
|
||||
|
||||
@@ -127,9 +127,9 @@ public function getName()
|
||||
* @param string $var
|
||||
* @return $this
|
||||
*/
|
||||
public function setName($var)
|
||||
public function setName(string $var)
|
||||
{
|
||||
GPBUtil::checkString($var, True);
|
||||
GPBUtil::checkString($var, true);
|
||||
$this->name = $var;
|
||||
|
||||
return $this;
|
||||
@@ -155,9 +155,9 @@ public function getRoot()
|
||||
* @param string $var
|
||||
* @return $this
|
||||
*/
|
||||
public function setRoot($var)
|
||||
public function setRoot(string $var)
|
||||
{
|
||||
GPBUtil::checkString($var, True);
|
||||
GPBUtil::checkString($var, true);
|
||||
$this->root = $var;
|
||||
|
||||
return $this;
|
||||
|
||||
@@ -86,9 +86,9 @@ public function getName()
|
||||
* @param string $var
|
||||
* @return $this
|
||||
*/
|
||||
public function setName($var)
|
||||
public function setName(string $var)
|
||||
{
|
||||
GPBUtil::checkString($var, True);
|
||||
GPBUtil::checkString($var, true);
|
||||
$this->name = $var;
|
||||
|
||||
return $this;
|
||||
@@ -128,9 +128,8 @@ public function clearValue()
|
||||
* @param \Google\Protobuf\Any $var
|
||||
* @return $this
|
||||
*/
|
||||
public function setValue($var)
|
||||
public function setValue(\Google\Protobuf\Any|null $var)
|
||||
{
|
||||
GPBUtil::checkMessage($var, \Google\Protobuf\Any::class);
|
||||
$this->value = $var;
|
||||
|
||||
return $this;
|
||||
|
||||
@@ -13,4 +13,5 @@ class PrintOptions
|
||||
{
|
||||
const PRESERVE_PROTO_FIELD_NAMES = 1 << 0;
|
||||
const ALWAYS_PRINT_ENUMS_AS_INTS = 1 << 1;
|
||||
}
|
||||
const EMIT_DEFAULTS = 1 << 2;
|
||||
}
|
||||
|
||||
@@ -61,9 +61,9 @@ public function getFileName()
|
||||
* @param string $var
|
||||
* @return $this
|
||||
*/
|
||||
public function setFileName($var)
|
||||
public function setFileName(string $var)
|
||||
{
|
||||
GPBUtil::checkString($var, True);
|
||||
GPBUtil::checkString($var, true);
|
||||
$this->file_name = $var;
|
||||
|
||||
return $this;
|
||||
|
||||
@@ -59,9 +59,9 @@ public function getValue()
|
||||
* @param string $var
|
||||
* @return $this
|
||||
*/
|
||||
public function setValue($var)
|
||||
public function setValue(string $var)
|
||||
{
|
||||
GPBUtil::checkString($var, True);
|
||||
GPBUtil::checkString($var, true);
|
||||
$this->value = $var;
|
||||
|
||||
return $this;
|
||||
|
||||
@@ -62,7 +62,7 @@ public function getFields()
|
||||
* @param array|\Google\Protobuf\Internal\MapField $var
|
||||
* @return $this
|
||||
*/
|
||||
public function setFields($var)
|
||||
public function setFields(array|\Google\Protobuf\Internal\MapField $var)
|
||||
{
|
||||
$arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Value::class);
|
||||
$this->fields = $arr;
|
||||
|
||||
@@ -61,8 +61,8 @@
|
||||
* {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional
|
||||
* seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution),
|
||||
* are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone
|
||||
* is required. A proto3 JSON serializer should always use UTC (as indicated by
|
||||
* "Z") when printing the Timestamp type and a proto3 JSON parser should be
|
||||
* is required. A ProtoJSON serializer should always use UTC (as indicated by
|
||||
* "Z") when printing the Timestamp type and a ProtoJSON parser should be
|
||||
* able to accept both UTC and other timezones (as indicated by an offset).
|
||||
* For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past
|
||||
* 01:30 UTC on January 15, 2017.
|
||||
@@ -83,7 +83,7 @@ class Timestamp extends \Google\Protobuf\Internal\TimestampBase
|
||||
{
|
||||
/**
|
||||
* Represents seconds of UTC time since Unix epoch 1970-01-01T00:00:00Z. Must
|
||||
* be between -315576000000 and 315576000000 inclusive (which corresponds to
|
||||
* be between -62135596800 and 253402300799 inclusive (which corresponds to
|
||||
* 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z).
|
||||
*
|
||||
* Generated from protobuf field <code>int64 seconds = 1;</code>
|
||||
@@ -108,7 +108,7 @@ class Timestamp extends \Google\Protobuf\Internal\TimestampBase
|
||||
*
|
||||
* @type int|string $seconds
|
||||
* Represents seconds of UTC time since Unix epoch 1970-01-01T00:00:00Z. Must
|
||||
* be between -315576000000 and 315576000000 inclusive (which corresponds to
|
||||
* be between -62135596800 and 253402300799 inclusive (which corresponds to
|
||||
* 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z).
|
||||
* @type int $nanos
|
||||
* Non-negative fractions of a second at nanosecond resolution. This field is
|
||||
@@ -125,7 +125,7 @@ public function __construct($data = NULL) {
|
||||
|
||||
/**
|
||||
* Represents seconds of UTC time since Unix epoch 1970-01-01T00:00:00Z. Must
|
||||
* be between -315576000000 and 315576000000 inclusive (which corresponds to
|
||||
* be between -62135596800 and 253402300799 inclusive (which corresponds to
|
||||
* 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z).
|
||||
*
|
||||
* Generated from protobuf field <code>int64 seconds = 1;</code>
|
||||
@@ -138,14 +138,14 @@ public function getSeconds()
|
||||
|
||||
/**
|
||||
* Represents seconds of UTC time since Unix epoch 1970-01-01T00:00:00Z. Must
|
||||
* be between -315576000000 and 315576000000 inclusive (which corresponds to
|
||||
* be between -62135596800 and 253402300799 inclusive (which corresponds to
|
||||
* 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z).
|
||||
*
|
||||
* Generated from protobuf field <code>int64 seconds = 1;</code>
|
||||
* @param int|string $var
|
||||
* @return $this
|
||||
*/
|
||||
public function setSeconds($var)
|
||||
public function setSeconds(int|string $var)
|
||||
{
|
||||
GPBUtil::checkInt64($var);
|
||||
$this->seconds = $var;
|
||||
@@ -179,7 +179,7 @@ public function getNanos()
|
||||
* @param int $var
|
||||
* @return $this
|
||||
*/
|
||||
public function setNanos($var)
|
||||
public function setNanos(int $var)
|
||||
{
|
||||
GPBUtil::checkInt32($var);
|
||||
$this->nanos = $var;
|
||||
|
||||
@@ -108,9 +108,9 @@ public function getName()
|
||||
* @param string $var
|
||||
* @return $this
|
||||
*/
|
||||
public function setName($var)
|
||||
public function setName(string $var)
|
||||
{
|
||||
GPBUtil::checkString($var, True);
|
||||
GPBUtil::checkString($var, true);
|
||||
$this->name = $var;
|
||||
|
||||
return $this;
|
||||
@@ -134,7 +134,7 @@ public function getFields()
|
||||
* @param \Google\Protobuf\Field[] $var
|
||||
* @return $this
|
||||
*/
|
||||
public function setFields($var)
|
||||
public function setFields(array|RepeatedField $var)
|
||||
{
|
||||
$arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Field::class);
|
||||
$this->fields = $arr;
|
||||
@@ -160,7 +160,7 @@ public function getOneofs()
|
||||
* @param string[] $var
|
||||
* @return $this
|
||||
*/
|
||||
public function setOneofs($var)
|
||||
public function setOneofs(array|RepeatedField $var)
|
||||
{
|
||||
$arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING);
|
||||
$this->oneofs = $arr;
|
||||
@@ -186,7 +186,7 @@ public function getOptions()
|
||||
* @param \Google\Protobuf\Option[] $var
|
||||
* @return $this
|
||||
*/
|
||||
public function setOptions($var)
|
||||
public function setOptions(array|RepeatedField $var)
|
||||
{
|
||||
$arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Option::class);
|
||||
$this->options = $arr;
|
||||
@@ -222,9 +222,8 @@ public function clearSourceContext()
|
||||
* @param \Google\Protobuf\SourceContext $var
|
||||
* @return $this
|
||||
*/
|
||||
public function setSourceContext($var)
|
||||
public function setSourceContext(\Google\Protobuf\SourceContext|null $var)
|
||||
{
|
||||
GPBUtil::checkMessage($var, \Google\Protobuf\SourceContext::class);
|
||||
$this->source_context = $var;
|
||||
|
||||
return $this;
|
||||
@@ -234,7 +233,7 @@ public function setSourceContext($var)
|
||||
* The source syntax.
|
||||
*
|
||||
* Generated from protobuf field <code>.google.protobuf.Syntax syntax = 6;</code>
|
||||
* @return int
|
||||
* @return int one of the values in {@see \Google\Protobuf\Syntax}
|
||||
*/
|
||||
public function getSyntax()
|
||||
{
|
||||
@@ -245,10 +244,10 @@ public function getSyntax()
|
||||
* The source syntax.
|
||||
*
|
||||
* Generated from protobuf field <code>.google.protobuf.Syntax syntax = 6;</code>
|
||||
* @param int $var
|
||||
* @param int $var one of the values in {@see \Google\Protobuf\Syntax}
|
||||
* @return $this
|
||||
*/
|
||||
public function setSyntax($var)
|
||||
public function setSyntax(int $var)
|
||||
{
|
||||
GPBUtil::checkEnum($var, \Google\Protobuf\Syntax::class);
|
||||
$this->syntax = $var;
|
||||
@@ -274,9 +273,9 @@ public function getEdition()
|
||||
* @param string $var
|
||||
* @return $this
|
||||
*/
|
||||
public function setEdition($var)
|
||||
public function setEdition(string $var)
|
||||
{
|
||||
GPBUtil::checkString($var, True);
|
||||
GPBUtil::checkString($var, true);
|
||||
$this->edition = $var;
|
||||
|
||||
return $this;
|
||||
|
||||
@@ -59,7 +59,7 @@ public function getValue()
|
||||
* @param int $var
|
||||
* @return $this
|
||||
*/
|
||||
public function setValue($var)
|
||||
public function setValue(int $var)
|
||||
{
|
||||
GPBUtil::checkUint32($var);
|
||||
$this->value = $var;
|
||||
|
||||
@@ -59,7 +59,7 @@ public function getValue()
|
||||
* @param int|string $var
|
||||
* @return $this
|
||||
*/
|
||||
public function setValue($var)
|
||||
public function setValue(int|string $var)
|
||||
{
|
||||
GPBUtil::checkUint64($var);
|
||||
$this->value = $var;
|
||||
|
||||
@@ -51,7 +51,7 @@ public function __construct($data = NULL) {
|
||||
* Represents a null value.
|
||||
*
|
||||
* Generated from protobuf field <code>.google.protobuf.NullValue null_value = 1;</code>
|
||||
* @return int
|
||||
* @return int one of the values in {@see \Google\Protobuf\NullValue}
|
||||
*/
|
||||
public function getNullValue()
|
||||
{
|
||||
@@ -67,10 +67,10 @@ public function hasNullValue()
|
||||
* Represents a null value.
|
||||
*
|
||||
* Generated from protobuf field <code>.google.protobuf.NullValue null_value = 1;</code>
|
||||
* @param int $var
|
||||
* @param int $var one of the values in {@see \Google\Protobuf\NullValue}
|
||||
* @return $this
|
||||
*/
|
||||
public function setNullValue($var)
|
||||
public function setNullValue(int $var)
|
||||
{
|
||||
GPBUtil::checkEnum($var, \Google\Protobuf\NullValue::class);
|
||||
$this->writeOneof(1, $var);
|
||||
@@ -101,9 +101,8 @@ public function hasNumberValue()
|
||||
* @param float $var
|
||||
* @return $this
|
||||
*/
|
||||
public function setNumberValue($var)
|
||||
public function setNumberValue(float $var)
|
||||
{
|
||||
GPBUtil::checkDouble($var);
|
||||
$this->writeOneof(2, $var);
|
||||
|
||||
return $this;
|
||||
@@ -132,9 +131,9 @@ public function hasStringValue()
|
||||
* @param string $var
|
||||
* @return $this
|
||||
*/
|
||||
public function setStringValue($var)
|
||||
public function setStringValue(string $var)
|
||||
{
|
||||
GPBUtil::checkString($var, True);
|
||||
GPBUtil::checkString($var, true);
|
||||
$this->writeOneof(3, $var);
|
||||
|
||||
return $this;
|
||||
@@ -163,9 +162,8 @@ public function hasBoolValue()
|
||||
* @param bool $var
|
||||
* @return $this
|
||||
*/
|
||||
public function setBoolValue($var)
|
||||
public function setBoolValue(bool $var)
|
||||
{
|
||||
GPBUtil::checkBool($var);
|
||||
$this->writeOneof(4, $var);
|
||||
|
||||
return $this;
|
||||
@@ -194,9 +192,8 @@ public function hasStructValue()
|
||||
* @param \Google\Protobuf\Struct $var
|
||||
* @return $this
|
||||
*/
|
||||
public function setStructValue($var)
|
||||
public function setStructValue(\Google\Protobuf\Struct|null $var)
|
||||
{
|
||||
GPBUtil::checkMessage($var, \Google\Protobuf\Struct::class);
|
||||
$this->writeOneof(5, $var);
|
||||
|
||||
return $this;
|
||||
@@ -225,9 +222,8 @@ public function hasListValue()
|
||||
* @param \Google\Protobuf\ListValue $var
|
||||
* @return $this
|
||||
*/
|
||||
public function setListValue($var)
|
||||
public function setListValue(\Google\Protobuf\ListValue|null $var)
|
||||
{
|
||||
GPBUtil::checkMessage($var, \Google\Protobuf\ListValue::class);
|
||||
$this->writeOneof(6, $var);
|
||||
|
||||
return $this;
|
||||
|
||||
Reference in New Issue
Block a user