aboutsummaryrefslogtreecommitdiffhomepage
path: root/php/src/Google/Protobuf/Internal/GeneratedCodeInfo_Annotation.php
diff options
context:
space:
mode:
authorGravatar Brent Shaffer <betterbrent@google.com>2018-05-02 14:40:15 -0700
committerGravatar Bo Yang <teboring@google.com>2018-05-25 13:03:58 -0700
commitc9b404d23bdf3dd8f1556b19a27dcba40565e3e4 (patch)
treee62606471c739037a4f7e40757c26f0225b15649 /php/src/Google/Protobuf/Internal/GeneratedCodeInfo_Annotation.php
parent7eba62465375b15a28d3f7bbd08f4f517b90b076 (diff)
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/GeneratedCodeInfo_Annotation.php')
-rw-r--r--php/src/Google/Protobuf/Internal/GeneratedCodeInfo_Annotation.php24
1 files changed, 22 insertions, 2 deletions
diff --git a/php/src/Google/Protobuf/Internal/GeneratedCodeInfo_Annotation.php b/php/src/Google/Protobuf/Internal/GeneratedCodeInfo_Annotation.php
index 22ac2337..75182007 100644
--- a/php/src/Google/Protobuf/Internal/GeneratedCodeInfo_Annotation.php
+++ b/php/src/Google/Protobuf/Internal/GeneratedCodeInfo_Annotation.php
@@ -48,9 +48,29 @@ class GeneratedCodeInfo_Annotation extends \Google\Protobuf\Internal\Message
private $end = 0;
private $has_end = false;
- public function __construct() {
+ /**
+ * Constructor.
+ *
+ * @param array $data {
+ * Optional. Data for populating the Message object.
+ *
+ * @type int[]|\Google\Protobuf\Internal\RepeatedField $path
+ * Identifies the element in the original source .proto file. This field
+ * is formatted the same as SourceCodeInfo.Location.path.
+ * @type string $source_file
+ * Identifies the filesystem path to the original source .proto.
+ * @type int $begin
+ * Identifies the starting offset in bytes in the generated code
+ * that relates to the identified object.
+ * @type int $end
+ * Identifies the ending offset in bytes in the generated code that
+ * relates to the identified offset. The end offset should be one past
+ * the last relevant byte (so the length of the text = end - begin).
+ * }
+ */
+ public function __construct($data = NULL) {
\GPBMetadata\Google\Protobuf\Internal\Descriptor::initOnce();
- parent::__construct();
+ parent::__construct($data);
}
/**