diff options
author | Stanley Cheung <stanley.cheung@gmail.com> | 2016-09-22 17:09:32 -0700 |
---|---|---|
committer | Bo Yang <teboring@google.com> | 2016-10-10 11:44:21 -0700 |
commit | 9372292b2940bba4e69904744eee358f0bcfc436 (patch) | |
tree | 9beffe7bdc7dadff72f304b805948326019bbdab /php/src | |
parent | f933d10fbe701df5166ca18764e4ef0922559b66 (diff) | |
download | protobuf-9372292b2940bba4e69904744eee358f0bcfc436.tar.gz protobuf-9372292b2940bba4e69904744eee358f0bcfc436.tar.bz2 protobuf-9372292b2940bba4e69904744eee358f0bcfc436.zip |
PHP: support 7.0 on PHP implementation (#2162)
* PHP: support 7.0
* Also fix in test_util.php
Diffstat (limited to 'php/src')
-rw-r--r-- | php/src/Google/Protobuf/Internal/Message.php | 45 |
1 files changed, 24 insertions, 21 deletions
diff --git a/php/src/Google/Protobuf/Internal/Message.php b/php/src/Google/Protobuf/Internal/Message.php index a8de6a11..7bdc6a8c 100644 --- a/php/src/Google/Protobuf/Internal/Message.php +++ b/php/src/Google/Protobuf/Internal/Message.php @@ -81,41 +81,44 @@ class Message switch ($value_field->getType()) { case GPBType::MESSAGE: case GPBType::GROUP: - $this->$setter( - new MapField( - $key_field->getType(), - $value_field->getType(), - $value_field->getMessageType()->getClass())); + $map_field = new MapField( + $key_field->getType(), + $value_field->getType(), + $value_field->getMessageType()->getClass()); + $this->$setter($map_field); break; case GPBType::ENUM: - $this->$setter( - new MapField( - $key_field->getType(), - $value_field->getType(), - $value_field->getEnumType()->getClass())); + $map_field = new MapField( + $key_field->getType(), + $value_field->getType(), + $value_field->getEnumType()->getClass()); + $this->$setter($map_field); break; default: - $this->$setter(new MapField($key_field->getType(), - $value_field->getType())); + $map_field = new MapField( + $key_field->getType(), + $value_field->getType()); + $this->$setter($map_field); break; } } else if ($field->getLabel() === GPBLabel::REPEATED) { switch ($field->getType()) { case GPBType::MESSAGE: case GPBType::GROUP: - $this->$setter( - new RepeatedField( - $field->getType(), - $field->getMessageType()->getClass())); + $repeated_field = new RepeatedField( + $field->getType(), + $field->getMessageType()->getClass()); + $this->$setter($repeated_field); break; case GPBType::ENUM: - $this->$setter( - new RepeatedField( - $field->getType(), - $field->getEnumType()->getClass())); + $repeated_field = new RepeatedField( + $field->getType(), + $field->getEnumType()->getClass()); + $this->$setter($repeated_field); break; default: - $this->$setter(new RepeatedField($field->getType())); + $repeated_field = new RepeatedField($field->getType()); + $this->$setter($repeated_field); break; } } else if ($field->getOneofIndex() !== -1) { |