aboutsummaryrefslogtreecommitdiff
path: root/php/src/Google/Protobuf/Internal/RepeatedField.php
diff options
context:
space:
mode:
authorFeng Xiao <xfxyjwf@gmail.com>2018-07-17 18:50:04 -0700
committerGitHub <noreply@github.com>2018-07-17 18:50:04 -0700
commitd85ffdce419eb3e5b8444e2fed7c9e13f3b9637e (patch)
tree6224f98ad30e99dc2d896423853892f2142f16ed /php/src/Google/Protobuf/Internal/RepeatedField.php
parent22503a01722939385a7584c3b65f1c43dc5b2ef8 (diff)
parent8356d270a54e18c21f4feac6f5e2b6f1061dc8d5 (diff)
downloadprotobuf-d85ffdce419eb3e5b8444e2fed7c9e13f3b9637e.tar.gz
protobuf-d85ffdce419eb3e5b8444e2fed7c9e13f3b9637e.tar.bz2
protobuf-d85ffdce419eb3e5b8444e2fed7c9e13f3b9637e.zip
Merge pull request #4924 from xfxyjwf/3.6.x
Cherry-pick master build fixes and kokoro changes to 3.6.x
Diffstat (limited to 'php/src/Google/Protobuf/Internal/RepeatedField.php')
-rw-r--r--php/src/Google/Protobuf/Internal/RepeatedField.php10
1 files changed, 10 insertions, 0 deletions
diff --git a/php/src/Google/Protobuf/Internal/RepeatedField.php b/php/src/Google/Protobuf/Internal/RepeatedField.php
index e0ddef50..e9b92d8d 100644
--- a/php/src/Google/Protobuf/Internal/RepeatedField.php
+++ b/php/src/Google/Protobuf/Internal/RepeatedField.php
@@ -141,15 +141,22 @@ class RepeatedField implements \ArrayAccess, \IteratorAggregate, \Countable
public function offsetSet($offset, $value)
{
switch ($this->type) {
+ case GPBType::SFIXED32:
+ case GPBType::SINT32:
case GPBType::INT32:
+ case GPBType::ENUM:
GPBUtil::checkInt32($value);
break;
+ case GPBType::FIXED32:
case GPBType::UINT32:
GPBUtil::checkUint32($value);
break;
+ case GPBType::SFIXED64:
+ case GPBType::SINT64:
case GPBType::INT64:
GPBUtil::checkInt64($value);
break;
+ case GPBType::FIXED64:
case GPBType::UINT64:
GPBUtil::checkUint64($value);
break;
@@ -162,6 +169,9 @@ class RepeatedField implements \ArrayAccess, \IteratorAggregate, \Countable
case GPBType::BOOL:
GPBUtil::checkBool($value);
break;
+ case GPBType::BYTES:
+ GPBUtil::checkString($value, false);
+ break;
case GPBType::STRING:
GPBUtil::checkString($value, true);
break;