diff options
author | Paul Yang <TeBoring@users.noreply.github.com> | 2017-11-13 09:31:28 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-11-13 09:31:28 -0800 |
commit | 188f18044feb1ca82ecc922f3e59e37078473ddf (patch) | |
tree | d47aff9f88bc90df1a88823a291487f90e472d5f /php/src/Google/Protobuf/Internal | |
parent | fe2b4af3d1b421bd2354dbe59fab942c01ab2067 (diff) |
All integer types should accept null in json. (#3869)
Diffstat (limited to 'php/src/Google/Protobuf/Internal')
-rw-r--r-- | php/src/Google/Protobuf/Internal/Message.php | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/php/src/Google/Protobuf/Internal/Message.php b/php/src/Google/Protobuf/Internal/Message.php index 9785be30..a7a4f272 100644 --- a/php/src/Google/Protobuf/Internal/Message.php +++ b/php/src/Google/Protobuf/Internal/Message.php @@ -833,6 +833,8 @@ class Message } return $value; case GPBType::INT32: + case GPBType::SINT32: + case GPBType::SFIXED32: if (is_null($value)) { return $this->defaultValue($field); } @@ -850,6 +852,7 @@ class Message } return $value; case GPBType::UINT32: + case GPBType::FIXED32: if (is_null($value)) { return $this->defaultValue($field); } @@ -863,6 +866,8 @@ class Message } return $value; case GPBType::INT64: + case GPBType::SINT64: + case GPBType::SFIXED64: if (is_null($value)) { return $this->defaultValue($field); } @@ -880,6 +885,7 @@ class Message } return $value; case GPBType::UINT64: + case GPBType::FIXED64: if (is_null($value)) { return $this->defaultValue($field); } @@ -895,11 +901,6 @@ class Message $value = bcsub($value, "18446744073709551616"); } return $value; - case GPBType::FIXED64: - if (is_null($value)) { - return $this->defaultValue($field); - } - return $value; default: return $value; } |