diff options
author | Brent Shaffer <betterbrent@google.com> | 2018-05-02 14:40:15 -0700 |
---|---|---|
committer | Paul Yang <TeBoring@users.noreply.github.com> | 2018-05-24 13:39:41 -0700 |
commit | f1911f37f817fb2dddbb07478bdcda526488fc55 (patch) | |
tree | 402d04901ea74eef1e161aca8a370439760bdb1e /php/src/Google/Protobuf/Internal/OneofOptions.php | |
parent | b625aabbe75f91bb4974b5c75106233ed2761dbb (diff) | |
download | protobuf-f1911f37f817fb2dddbb07478bdcda526488fc55.tar.gz protobuf-f1911f37f817fb2dddbb07478bdcda526488fc55.tar.bz2 protobuf-f1911f37f817fb2dddbb07478bdcda526488fc55.zip |
PHP array constructors for protobuf messages (#4530)
* PHP array constructors for protobuf messages
* removes Descriptor from error message
* allows mergeFrom to accept an array
* only use initWithDescriptor if instanceof MapEntry
* adds doc comments
* removes ability for constructors to take arrays for submessages
* Revert "allows mergeFrom to accept an array"
This reverts commit b7b72182d561634af12c5c5c56a7cda3b33241f9.
* makes mergeFromArray protected and fixes mergeFrom whitespace
* Separates merging from JSON and merging from PHP array
* removes well-known types and json keys from array construction
* Addresses PR review comments
* cleans up tests
* fixes exception messages
Diffstat (limited to 'php/src/Google/Protobuf/Internal/OneofOptions.php')
-rw-r--r-- | php/src/Google/Protobuf/Internal/OneofOptions.php | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/php/src/Google/Protobuf/Internal/OneofOptions.php b/php/src/Google/Protobuf/Internal/OneofOptions.php index e5b4633d..46b516f3 100644 --- a/php/src/Google/Protobuf/Internal/OneofOptions.php +++ b/php/src/Google/Protobuf/Internal/OneofOptions.php @@ -23,9 +23,19 @@ class OneofOptions extends \Google\Protobuf\Internal\Message private $uninterpreted_option; private $has_uninterpreted_option = false; - public function __construct() { + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\Internal\UninterpretedOption[]|\Google\Protobuf\Internal\RepeatedField $uninterpreted_option + * The parser stores options it doesn't recognize here. See above. + * } + */ + public function __construct($data = NULL) { \GPBMetadata\Google\Protobuf\Internal\Descriptor::initOnce(); - parent::__construct(); + parent::__construct($data); } /** |