From f8ca3acd2924421dc18f685c629a6e54875ac113 Mon Sep 17 00:00:00 2001 From: Paul Yang Date: Thu, 1 Dec 2016 14:50:53 -0800 Subject: Generate phpdoc in php generated files. (#2406) --- php/tests/test.pb.php | 948 +++++++++++++++++++++++++++++++++++++++++- php/tests/test.proto | 5 + php/tests/test_include.pb.php | 12 + 3 files changed, 961 insertions(+), 4 deletions(-) (limited to 'php/tests') diff --git a/php/tests/test.pb.php b/php/tests/test.pb.php index ed316b6e..87332ae9 100644 --- a/php/tests/test.pb.php +++ b/php/tests/test.pb.php @@ -10,834 +10,1458 @@ use Google\Protobuf\Internal\GPBType; use Google\Protobuf\Internal\RepeatedField; use Google\Protobuf\Internal\GPBUtil; +/** + * Protobuf type foo.TestMessage + */ class TestMessage extends \Google\Protobuf\Internal\Message { + /** + *
+     * Singular
+     * 
+ * + * optional int32 optional_int32 = 1; + */ private $optional_int32 = 0; + /** + * optional int64 optional_int64 = 2; + */ private $optional_int64 = 0; + /** + * optional uint32 optional_uint32 = 3; + */ private $optional_uint32 = 0; + /** + * optional uint64 optional_uint64 = 4; + */ private $optional_uint64 = 0; + /** + * optional sint32 optional_sint32 = 5; + */ private $optional_sint32 = 0; + /** + * optional sint64 optional_sint64 = 6; + */ private $optional_sint64 = 0; + /** + * optional fixed32 optional_fixed32 = 7; + */ private $optional_fixed32 = 0; + /** + * optional fixed64 optional_fixed64 = 8; + */ private $optional_fixed64 = 0; + /** + * optional sfixed32 optional_sfixed32 = 9; + */ private $optional_sfixed32 = 0; + /** + * optional sfixed64 optional_sfixed64 = 10; + */ private $optional_sfixed64 = 0; + /** + * optional float optional_float = 11; + */ private $optional_float = 0.0; + /** + * optional double optional_double = 12; + */ private $optional_double = 0.0; + /** + * optional bool optional_bool = 13; + */ private $optional_bool = false; + /** + * optional string optional_string = 14; + */ private $optional_string = ''; + /** + * optional bytes optional_bytes = 15; + */ private $optional_bytes = ''; + /** + * optional .foo.TestEnum optional_enum = 16; + */ private $optional_enum = 0; + /** + * optional .foo.TestMessage.Sub optional_message = 17; + */ private $optional_message = null; + /** + * optional .bar.TestInclude optional_included_message = 18; + */ private $optional_included_message = null; + /** + * optional .foo.TestMessage recursive = 19; + */ private $recursive = null; + /** + *
+     * Repeated
+     * 
+ * + * repeated int32 repeated_int32 = 31; + */ private $repeated_int32; + /** + * repeated int64 repeated_int64 = 32; + */ private $repeated_int64; + /** + * repeated uint32 repeated_uint32 = 33; + */ private $repeated_uint32; + /** + * repeated uint64 repeated_uint64 = 34; + */ private $repeated_uint64; + /** + * repeated sint32 repeated_sint32 = 35; + */ private $repeated_sint32; + /** + * repeated sint64 repeated_sint64 = 36; + */ private $repeated_sint64; + /** + * repeated fixed32 repeated_fixed32 = 37; + */ private $repeated_fixed32; + /** + * repeated fixed64 repeated_fixed64 = 38; + */ private $repeated_fixed64; + /** + * repeated sfixed32 repeated_sfixed32 = 39; + */ private $repeated_sfixed32; + /** + * repeated sfixed64 repeated_sfixed64 = 40; + */ private $repeated_sfixed64; + /** + * repeated float repeated_float = 41; + */ private $repeated_float; + /** + * repeated double repeated_double = 42; + */ private $repeated_double; + /** + * repeated bool repeated_bool = 43; + */ private $repeated_bool; + /** + * repeated string repeated_string = 44; + */ private $repeated_string; + /** + * repeated bytes repeated_bytes = 45; + */ private $repeated_bytes; + /** + * repeated .foo.TestEnum repeated_enum = 46; + */ private $repeated_enum; + /** + * repeated .foo.TestMessage.Sub repeated_message = 47; + */ private $repeated_message; + /** + * repeated .foo.TestMessage repeated_recursive = 48; + */ private $repeated_recursive; + /** + * map<int32, int32> map_int32_int32 = 71; + */ private $map_int32_int32; + /** + * map<int64, int64> map_int64_int64 = 72; + */ private $map_int64_int64; + /** + * map<uint32, uint32> map_uint32_uint32 = 73; + */ private $map_uint32_uint32; + /** + * map<uint64, uint64> map_uint64_uint64 = 74; + */ private $map_uint64_uint64; + /** + * map<sint32, sint32> map_sint32_sint32 = 75; + */ private $map_sint32_sint32; + /** + * map<sint64, sint64> map_sint64_sint64 = 76; + */ private $map_sint64_sint64; + /** + * map<fixed32, fixed32> map_fixed32_fixed32 = 77; + */ private $map_fixed32_fixed32; + /** + * map<fixed64, fixed64> map_fixed64_fixed64 = 78; + */ private $map_fixed64_fixed64; + /** + * map<sfixed32, sfixed32> map_sfixed32_sfixed32 = 79; + */ private $map_sfixed32_sfixed32; + /** + * map<sfixed64, sfixed64> map_sfixed64_sfixed64 = 80; + */ private $map_sfixed64_sfixed64; + /** + * map<int32, float> map_int32_float = 81; + */ private $map_int32_float; + /** + * map<int32, double> map_int32_double = 82; + */ private $map_int32_double; + /** + * map<bool, bool> map_bool_bool = 83; + */ private $map_bool_bool; + /** + * map<string, string> map_string_string = 84; + */ private $map_string_string; + /** + * map<int32, bytes> map_int32_bytes = 85; + */ private $map_int32_bytes; + /** + * map<int32, .foo.TestEnum> map_int32_enum = 86; + */ private $map_int32_enum; + /** + * map<int32, .foo.TestMessage.Sub> map_int32_message = 87; + */ private $map_int32_message; + /** + * map<int32, .foo.TestMessage> map_recursive = 88; + */ private $map_recursive; protected $my_oneof; + /** + *
+     * Singular
+     * 
+ * + * optional int32 optional_int32 = 1; + */ public function getOptionalInt32() { return $this->optional_int32; } + /** + *
+     * Singular
+     * 
+ * + * optional int32 optional_int32 = 1; + */ public function setOptionalInt32($var) { GPBUtil::checkInt32($var); $this->optional_int32 = $var; } + /** + * optional int64 optional_int64 = 2; + */ public function getOptionalInt64() { return $this->optional_int64; } + /** + * optional int64 optional_int64 = 2; + */ public function setOptionalInt64($var) { GPBUtil::checkInt64($var); $this->optional_int64 = $var; } + /** + * optional uint32 optional_uint32 = 3; + */ public function getOptionalUint32() { return $this->optional_uint32; } + /** + * optional uint32 optional_uint32 = 3; + */ public function setOptionalUint32($var) { GPBUtil::checkUint32($var); $this->optional_uint32 = $var; } + /** + * optional uint64 optional_uint64 = 4; + */ public function getOptionalUint64() { return $this->optional_uint64; } + /** + * optional uint64 optional_uint64 = 4; + */ public function setOptionalUint64($var) { GPBUtil::checkUint64($var); $this->optional_uint64 = $var; } + /** + * optional sint32 optional_sint32 = 5; + */ public function getOptionalSint32() { return $this->optional_sint32; } + /** + * optional sint32 optional_sint32 = 5; + */ public function setOptionalSint32($var) { GPBUtil::checkInt32($var); $this->optional_sint32 = $var; } + /** + * optional sint64 optional_sint64 = 6; + */ public function getOptionalSint64() { return $this->optional_sint64; } + /** + * optional sint64 optional_sint64 = 6; + */ public function setOptionalSint64($var) { GPBUtil::checkInt64($var); $this->optional_sint64 = $var; } + /** + * optional fixed32 optional_fixed32 = 7; + */ public function getOptionalFixed32() { return $this->optional_fixed32; } + /** + * optional fixed32 optional_fixed32 = 7; + */ public function setOptionalFixed32($var) { GPBUtil::checkUint32($var); $this->optional_fixed32 = $var; } + /** + * optional fixed64 optional_fixed64 = 8; + */ public function getOptionalFixed64() { return $this->optional_fixed64; } + /** + * optional fixed64 optional_fixed64 = 8; + */ public function setOptionalFixed64($var) { GPBUtil::checkUint64($var); $this->optional_fixed64 = $var; } + /** + * optional sfixed32 optional_sfixed32 = 9; + */ public function getOptionalSfixed32() { return $this->optional_sfixed32; } + /** + * optional sfixed32 optional_sfixed32 = 9; + */ public function setOptionalSfixed32($var) { GPBUtil::checkInt32($var); $this->optional_sfixed32 = $var; } + /** + * optional sfixed64 optional_sfixed64 = 10; + */ public function getOptionalSfixed64() { return $this->optional_sfixed64; } + /** + * optional sfixed64 optional_sfixed64 = 10; + */ public function setOptionalSfixed64($var) { GPBUtil::checkInt64($var); $this->optional_sfixed64 = $var; } + /** + * optional float optional_float = 11; + */ public function getOptionalFloat() { return $this->optional_float; } + /** + * optional float optional_float = 11; + */ public function setOptionalFloat($var) { GPBUtil::checkFloat($var); $this->optional_float = $var; } + /** + * optional double optional_double = 12; + */ public function getOptionalDouble() { return $this->optional_double; } + /** + * optional double optional_double = 12; + */ public function setOptionalDouble($var) { GPBUtil::checkDouble($var); $this->optional_double = $var; } + /** + * optional bool optional_bool = 13; + */ public function getOptionalBool() { return $this->optional_bool; } + /** + * optional bool optional_bool = 13; + */ public function setOptionalBool($var) { GPBUtil::checkBool($var); $this->optional_bool = $var; } + /** + * optional string optional_string = 14; + */ public function getOptionalString() { return $this->optional_string; } + /** + * optional string optional_string = 14; + */ public function setOptionalString($var) { GPBUtil::checkString($var, True); $this->optional_string = $var; } + /** + * optional bytes optional_bytes = 15; + */ public function getOptionalBytes() { return $this->optional_bytes; } + /** + * optional bytes optional_bytes = 15; + */ public function setOptionalBytes($var) { GPBUtil::checkString($var, False); $this->optional_bytes = $var; } + /** + * optional .foo.TestEnum optional_enum = 16; + */ public function getOptionalEnum() { return $this->optional_enum; } + /** + * optional .foo.TestEnum optional_enum = 16; + */ public function setOptionalEnum($var) { GPBUtil::checkEnum($var, \Foo\TestEnum::class); $this->optional_enum = $var; } + /** + * optional .foo.TestMessage.Sub optional_message = 17; + */ public function getOptionalMessage() { return $this->optional_message; } + /** + * optional .foo.TestMessage.Sub optional_message = 17; + */ public function setOptionalMessage(&$var) { GPBUtil::checkMessage($var, \Foo\TestMessage_Sub::class); $this->optional_message = $var; } + /** + * optional .bar.TestInclude optional_included_message = 18; + */ public function getOptionalIncludedMessage() { return $this->optional_included_message; } + /** + * optional .bar.TestInclude optional_included_message = 18; + */ public function setOptionalIncludedMessage(&$var) { GPBUtil::checkMessage($var, \Bar\TestInclude::class); $this->optional_included_message = $var; } + /** + * optional .foo.TestMessage recursive = 19; + */ public function getRecursive() { return $this->recursive; } + /** + * optional .foo.TestMessage recursive = 19; + */ public function setRecursive(&$var) { GPBUtil::checkMessage($var, \Foo\TestMessage::class); $this->recursive = $var; } + /** + *
+     * Repeated
+     * 
+ * + * repeated int32 repeated_int32 = 31; + */ public function getRepeatedInt32() { return $this->repeated_int32; } + /** + *
+     * Repeated
+     * 
+ * + * repeated int32 repeated_int32 = 31; + */ public function setRepeatedInt32(&$var) { GPBUtil::checkRepeatedField($var, GPBType::INT32); $this->repeated_int32 = $var; } + /** + * repeated int64 repeated_int64 = 32; + */ public function getRepeatedInt64() { return $this->repeated_int64; } + /** + * repeated int64 repeated_int64 = 32; + */ public function setRepeatedInt64(&$var) { GPBUtil::checkRepeatedField($var, GPBType::INT64); $this->repeated_int64 = $var; } + /** + * repeated uint32 repeated_uint32 = 33; + */ public function getRepeatedUint32() { return $this->repeated_uint32; } + /** + * repeated uint32 repeated_uint32 = 33; + */ public function setRepeatedUint32(&$var) { GPBUtil::checkRepeatedField($var, GPBType::UINT32); $this->repeated_uint32 = $var; } + /** + * repeated uint64 repeated_uint64 = 34; + */ public function getRepeatedUint64() { return $this->repeated_uint64; } + /** + * repeated uint64 repeated_uint64 = 34; + */ public function setRepeatedUint64(&$var) { GPBUtil::checkRepeatedField($var, GPBType::UINT64); $this->repeated_uint64 = $var; } + /** + * repeated sint32 repeated_sint32 = 35; + */ public function getRepeatedSint32() { return $this->repeated_sint32; } + /** + * repeated sint32 repeated_sint32 = 35; + */ public function setRepeatedSint32(&$var) { GPBUtil::checkRepeatedField($var, GPBType::SINT32); $this->repeated_sint32 = $var; } + /** + * repeated sint64 repeated_sint64 = 36; + */ public function getRepeatedSint64() { return $this->repeated_sint64; } + /** + * repeated sint64 repeated_sint64 = 36; + */ public function setRepeatedSint64(&$var) { GPBUtil::checkRepeatedField($var, GPBType::SINT64); $this->repeated_sint64 = $var; } + /** + * repeated fixed32 repeated_fixed32 = 37; + */ public function getRepeatedFixed32() { return $this->repeated_fixed32; } + /** + * repeated fixed32 repeated_fixed32 = 37; + */ public function setRepeatedFixed32(&$var) { GPBUtil::checkRepeatedField($var, GPBType::FIXED32); $this->repeated_fixed32 = $var; } + /** + * repeated fixed64 repeated_fixed64 = 38; + */ public function getRepeatedFixed64() { return $this->repeated_fixed64; } + /** + * repeated fixed64 repeated_fixed64 = 38; + */ public function setRepeatedFixed64(&$var) { GPBUtil::checkRepeatedField($var, GPBType::FIXED64); $this->repeated_fixed64 = $var; } + /** + * repeated sfixed32 repeated_sfixed32 = 39; + */ public function getRepeatedSfixed32() { return $this->repeated_sfixed32; } + /** + * repeated sfixed32 repeated_sfixed32 = 39; + */ public function setRepeatedSfixed32(&$var) { GPBUtil::checkRepeatedField($var, GPBType::SFIXED32); $this->repeated_sfixed32 = $var; } + /** + * repeated sfixed64 repeated_sfixed64 = 40; + */ public function getRepeatedSfixed64() { return $this->repeated_sfixed64; } + /** + * repeated sfixed64 repeated_sfixed64 = 40; + */ public function setRepeatedSfixed64(&$var) { GPBUtil::checkRepeatedField($var, GPBType::SFIXED64); $this->repeated_sfixed64 = $var; } + /** + * repeated float repeated_float = 41; + */ public function getRepeatedFloat() { return $this->repeated_float; } + /** + * repeated float repeated_float = 41; + */ public function setRepeatedFloat(&$var) { GPBUtil::checkRepeatedField($var, GPBType::FLOAT); $this->repeated_float = $var; } + /** + * repeated double repeated_double = 42; + */ public function getRepeatedDouble() { return $this->repeated_double; } + /** + * repeated double repeated_double = 42; + */ public function setRepeatedDouble(&$var) { GPBUtil::checkRepeatedField($var, GPBType::DOUBLE); $this->repeated_double = $var; } + /** + * repeated bool repeated_bool = 43; + */ public function getRepeatedBool() { return $this->repeated_bool; } + /** + * repeated bool repeated_bool = 43; + */ public function setRepeatedBool(&$var) { GPBUtil::checkRepeatedField($var, GPBType::BOOL); $this->repeated_bool = $var; } + /** + * repeated string repeated_string = 44; + */ public function getRepeatedString() { return $this->repeated_string; } + /** + * repeated string repeated_string = 44; + */ public function setRepeatedString(&$var) { GPBUtil::checkRepeatedField($var, GPBType::STRING); $this->repeated_string = $var; } + /** + * repeated bytes repeated_bytes = 45; + */ public function getRepeatedBytes() { return $this->repeated_bytes; } + /** + * repeated bytes repeated_bytes = 45; + */ public function setRepeatedBytes(&$var) { GPBUtil::checkRepeatedField($var, GPBType::BYTES); $this->repeated_bytes = $var; } + /** + * repeated .foo.TestEnum repeated_enum = 46; + */ public function getRepeatedEnum() { return $this->repeated_enum; } + /** + * repeated .foo.TestEnum repeated_enum = 46; + */ public function setRepeatedEnum(&$var) { GPBUtil::checkRepeatedField($var, GPBType::ENUM, Foo\TestEnum::class); $this->repeated_enum = $var; } + /** + * repeated .foo.TestMessage.Sub repeated_message = 47; + */ public function getRepeatedMessage() { return $this->repeated_message; } + /** + * repeated .foo.TestMessage.Sub repeated_message = 47; + */ public function setRepeatedMessage(&$var) { GPBUtil::checkRepeatedField($var, GPBType::MESSAGE, \Foo\TestMessage_Sub::class); $this->repeated_message = $var; } + /** + * repeated .foo.TestMessage repeated_recursive = 48; + */ public function getRepeatedRecursive() { return $this->repeated_recursive; } + /** + * repeated .foo.TestMessage repeated_recursive = 48; + */ public function setRepeatedRecursive(&$var) { GPBUtil::checkRepeatedField($var, GPBType::MESSAGE, \Foo\TestMessage::class); $this->repeated_recursive = $var; } + /** + * optional int32 oneof_int32 = 51; + */ public function getOneofInt32() { return $this->readOneof(51); } + /** + * optional int32 oneof_int32 = 51; + */ public function setOneofInt32($var) { GPBUtil::checkInt32($var); $this->writeOneof(51, $var); } + /** + * optional int64 oneof_int64 = 52; + */ public function getOneofInt64() { return $this->readOneof(52); } + /** + * optional int64 oneof_int64 = 52; + */ public function setOneofInt64($var) { GPBUtil::checkInt64($var); $this->writeOneof(52, $var); } + /** + * optional uint32 oneof_uint32 = 53; + */ public function getOneofUint32() { return $this->readOneof(53); } + /** + * optional uint32 oneof_uint32 = 53; + */ public function setOneofUint32($var) { GPBUtil::checkUint32($var); $this->writeOneof(53, $var); } + /** + * optional uint64 oneof_uint64 = 54; + */ public function getOneofUint64() { return $this->readOneof(54); } + /** + * optional uint64 oneof_uint64 = 54; + */ public function setOneofUint64($var) { GPBUtil::checkUint64($var); $this->writeOneof(54, $var); } + /** + * optional uint32 oneof_sint32 = 55; + */ public function getOneofSint32() { return $this->readOneof(55); } + /** + * optional uint32 oneof_sint32 = 55; + */ public function setOneofSint32($var) { GPBUtil::checkUint32($var); $this->writeOneof(55, $var); } + /** + * optional uint64 oneof_sint64 = 56; + */ public function getOneofSint64() { return $this->readOneof(56); } + /** + * optional uint64 oneof_sint64 = 56; + */ public function setOneofSint64($var) { GPBUtil::checkUint64($var); $this->writeOneof(56, $var); } + /** + * optional uint32 oneof_fixed32 = 57; + */ public function getOneofFixed32() { return $this->readOneof(57); } + /** + * optional uint32 oneof_fixed32 = 57; + */ public function setOneofFixed32($var) { GPBUtil::checkUint32($var); $this->writeOneof(57, $var); } + /** + * optional uint64 oneof_fixed64 = 58; + */ public function getOneofFixed64() { return $this->readOneof(58); } + /** + * optional uint64 oneof_fixed64 = 58; + */ public function setOneofFixed64($var) { GPBUtil::checkUint64($var); $this->writeOneof(58, $var); } + /** + * optional uint32 oneof_sfixed32 = 59; + */ public function getOneofSfixed32() { return $this->readOneof(59); } + /** + * optional uint32 oneof_sfixed32 = 59; + */ public function setOneofSfixed32($var) { GPBUtil::checkUint32($var); $this->writeOneof(59, $var); } + /** + * optional uint64 oneof_sfixed64 = 60; + */ public function getOneofSfixed64() { return $this->readOneof(60); } + /** + * optional uint64 oneof_sfixed64 = 60; + */ public function setOneofSfixed64($var) { GPBUtil::checkUint64($var); $this->writeOneof(60, $var); } + /** + * optional double oneof_double = 61; + */ public function getOneofDouble() { return $this->readOneof(61); } + /** + * optional double oneof_double = 61; + */ public function setOneofDouble($var) { GPBUtil::checkDouble($var); $this->writeOneof(61, $var); } + /** + * optional float oneof_float = 62; + */ public function getOneofFloat() { return $this->readOneof(62); } + /** + * optional float oneof_float = 62; + */ public function setOneofFloat($var) { GPBUtil::checkFloat($var); $this->writeOneof(62, $var); } + /** + * optional bool oneof_bool = 63; + */ public function getOneofBool() { return $this->readOneof(63); } + /** + * optional bool oneof_bool = 63; + */ public function setOneofBool($var) { GPBUtil::checkBool($var); $this->writeOneof(63, $var); } + /** + * optional string oneof_string = 64; + */ public function getOneofString() { return $this->readOneof(64); } + /** + * optional string oneof_string = 64; + */ public function setOneofString($var) { GPBUtil::checkString($var, True); $this->writeOneof(64, $var); } + /** + * optional bytes oneof_bytes = 65; + */ public function getOneofBytes() { return $this->readOneof(65); } + /** + * optional bytes oneof_bytes = 65; + */ public function setOneofBytes($var) { GPBUtil::checkString($var, False); $this->writeOneof(65, $var); } + /** + * optional .foo.TestEnum oneof_enum = 66; + */ public function getOneofEnum() { return $this->readOneof(66); } + /** + * optional .foo.TestEnum oneof_enum = 66; + */ public function setOneofEnum($var) { GPBUtil::checkEnum($var, \Foo\TestEnum::class); $this->writeOneof(66, $var); } + /** + * optional .foo.TestMessage.Sub oneof_message = 67; + */ public function getOneofMessage() { return $this->readOneof(67); } + /** + * optional .foo.TestMessage.Sub oneof_message = 67; + */ public function setOneofMessage(&$var) { GPBUtil::checkMessage($var, \Foo\TestMessage_Sub::class); $this->writeOneof(67, $var); } + /** + * map<int32, int32> map_int32_int32 = 71; + */ public function getMapInt32Int32() { return $this->map_int32_int32; } + /** + * map<int32, int32> map_int32_int32 = 71; + */ public function setMapInt32Int32(&$var) { $this->map_int32_int32 = $var; } + /** + * map<int64, int64> map_int64_int64 = 72; + */ public function getMapInt64Int64() { return $this->map_int64_int64; } + /** + * map<int64, int64> map_int64_int64 = 72; + */ public function setMapInt64Int64(&$var) { $this->map_int64_int64 = $var; } + /** + * map<uint32, uint32> map_uint32_uint32 = 73; + */ public function getMapUint32Uint32() { return $this->map_uint32_uint32; } + /** + * map<uint32, uint32> map_uint32_uint32 = 73; + */ public function setMapUint32Uint32(&$var) { $this->map_uint32_uint32 = $var; } + /** + * map<uint64, uint64> map_uint64_uint64 = 74; + */ public function getMapUint64Uint64() { return $this->map_uint64_uint64; } + /** + * map<uint64, uint64> map_uint64_uint64 = 74; + */ public function setMapUint64Uint64(&$var) { $this->map_uint64_uint64 = $var; } + /** + * map<sint32, sint32> map_sint32_sint32 = 75; + */ public function getMapSint32Sint32() { return $this->map_sint32_sint32; } + /** + * map<sint32, sint32> map_sint32_sint32 = 75; + */ public function setMapSint32Sint32(&$var) { $this->map_sint32_sint32 = $var; } + /** + * map<sint64, sint64> map_sint64_sint64 = 76; + */ public function getMapSint64Sint64() { return $this->map_sint64_sint64; } + /** + * map<sint64, sint64> map_sint64_sint64 = 76; + */ public function setMapSint64Sint64(&$var) { $this->map_sint64_sint64 = $var; } + /** + * map<fixed32, fixed32> map_fixed32_fixed32 = 77; + */ public function getMapFixed32Fixed32() { return $this->map_fixed32_fixed32; } + /** + * map<fixed32, fixed32> map_fixed32_fixed32 = 77; + */ public function setMapFixed32Fixed32(&$var) { $this->map_fixed32_fixed32 = $var; } + /** + * map<fixed64, fixed64> map_fixed64_fixed64 = 78; + */ public function getMapFixed64Fixed64() { return $this->map_fixed64_fixed64; } + /** + * map<fixed64, fixed64> map_fixed64_fixed64 = 78; + */ public function setMapFixed64Fixed64(&$var) { $this->map_fixed64_fixed64 = $var; } + /** + * map<sfixed32, sfixed32> map_sfixed32_sfixed32 = 79; + */ public function getMapSfixed32Sfixed32() { return $this->map_sfixed32_sfixed32; } + /** + * map<sfixed32, sfixed32> map_sfixed32_sfixed32 = 79; + */ public function setMapSfixed32Sfixed32(&$var) { $this->map_sfixed32_sfixed32 = $var; } + /** + * map<sfixed64, sfixed64> map_sfixed64_sfixed64 = 80; + */ public function getMapSfixed64Sfixed64() { return $this->map_sfixed64_sfixed64; } + /** + * map<sfixed64, sfixed64> map_sfixed64_sfixed64 = 80; + */ public function setMapSfixed64Sfixed64(&$var) { $this->map_sfixed64_sfixed64 = $var; } + /** + * map<int32, float> map_int32_float = 81; + */ public function getMapInt32Float() { return $this->map_int32_float; } + /** + * map<int32, float> map_int32_float = 81; + */ public function setMapInt32Float(&$var) { $this->map_int32_float = $var; } + /** + * map<int32, double> map_int32_double = 82; + */ public function getMapInt32Double() { return $this->map_int32_double; } + /** + * map<int32, double> map_int32_double = 82; + */ public function setMapInt32Double(&$var) { $this->map_int32_double = $var; } + /** + * map<bool, bool> map_bool_bool = 83; + */ public function getMapBoolBool() { return $this->map_bool_bool; } + /** + * map<bool, bool> map_bool_bool = 83; + */ public function setMapBoolBool(&$var) { $this->map_bool_bool = $var; } + /** + * map<string, string> map_string_string = 84; + */ public function getMapStringString() { return $this->map_string_string; } + /** + * map<string, string> map_string_string = 84; + */ public function setMapStringString(&$var) { $this->map_string_string = $var; } + /** + * map<int32, bytes> map_int32_bytes = 85; + */ public function getMapInt32Bytes() { return $this->map_int32_bytes; } + /** + * map<int32, bytes> map_int32_bytes = 85; + */ public function setMapInt32Bytes(&$var) { $this->map_int32_bytes = $var; } + /** + * map<int32, .foo.TestEnum> map_int32_enum = 86; + */ public function getMapInt32Enum() { return $this->map_int32_enum; } + /** + * map<int32, .foo.TestEnum> map_int32_enum = 86; + */ public function setMapInt32Enum(&$var) { $this->map_int32_enum = $var; } + /** + * map<int32, .foo.TestMessage.Sub> map_int32_message = 87; + */ public function getMapInt32Message() { return $this->map_int32_message; } + /** + * map<int32, .foo.TestMessage.Sub> map_int32_message = 87; + */ public function setMapInt32Message(&$var) { $this->map_int32_message = $var; } + /** + * map<int32, .foo.TestMessage> map_recursive = 88; + */ public function getMapRecursive() { return $this->map_recursive; } + /** + * map<int32, .foo.TestMessage> map_recursive = 88; + */ public function setMapRecursive(&$var) { $this->map_recursive = $var; @@ -850,15 +1474,27 @@ class TestMessage extends \Google\Protobuf\Internal\Message } +/** + * Protobuf type foo.TestMessage.Sub + */ class TestMessage_Sub extends \Google\Protobuf\Internal\Message { + /** + * optional int32 a = 1; + */ private $a = 0; + /** + * optional int32 a = 1; + */ public function getA() { return $this->a; } + /** + * optional int32 a = 1; + */ public function setA($var) { GPBUtil::checkInt32($var); @@ -867,171 +1503,300 @@ class TestMessage_Sub extends \Google\Protobuf\Internal\Message } +/** + * Protobuf type foo.TestPackedMessage + */ class TestPackedMessage extends \Google\Protobuf\Internal\Message { + /** + * repeated int32 repeated_int32 = 90 [packed = true]; + */ private $repeated_int32; + /** + * repeated int64 repeated_int64 = 91 [packed = true]; + */ private $repeated_int64; + /** + * repeated uint32 repeated_uint32 = 92 [packed = true]; + */ private $repeated_uint32; + /** + * repeated uint64 repeated_uint64 = 93 [packed = true]; + */ private $repeated_uint64; + /** + * repeated sint32 repeated_sint32 = 94 [packed = true]; + */ private $repeated_sint32; + /** + * repeated sint64 repeated_sint64 = 95 [packed = true]; + */ private $repeated_sint64; + /** + * repeated fixed32 repeated_fixed32 = 96 [packed = true]; + */ private $repeated_fixed32; + /** + * repeated fixed64 repeated_fixed64 = 97 [packed = true]; + */ private $repeated_fixed64; + /** + * repeated sfixed32 repeated_sfixed32 = 98 [packed = true]; + */ private $repeated_sfixed32; + /** + * repeated sfixed64 repeated_sfixed64 = 99 [packed = true]; + */ private $repeated_sfixed64; + /** + * repeated float repeated_float = 100 [packed = true]; + */ private $repeated_float; + /** + * repeated double repeated_double = 101 [packed = true]; + */ private $repeated_double; + /** + * repeated bool repeated_bool = 102 [packed = true]; + */ private $repeated_bool; + /** + * repeated .foo.TestEnum repeated_enum = 103 [packed = true]; + */ private $repeated_enum; + /** + * repeated int32 repeated_int32 = 90 [packed = true]; + */ public function getRepeatedInt32() { return $this->repeated_int32; } + /** + * repeated int32 repeated_int32 = 90 [packed = true]; + */ public function setRepeatedInt32(&$var) { GPBUtil::checkRepeatedField($var, GPBType::INT32); $this->repeated_int32 = $var; } + /** + * repeated int64 repeated_int64 = 91 [packed = true]; + */ public function getRepeatedInt64() { return $this->repeated_int64; } + /** + * repeated int64 repeated_int64 = 91 [packed = true]; + */ public function setRepeatedInt64(&$var) { GPBUtil::checkRepeatedField($var, GPBType::INT64); $this->repeated_int64 = $var; } + /** + * repeated uint32 repeated_uint32 = 92 [packed = true]; + */ public function getRepeatedUint32() { return $this->repeated_uint32; } + /** + * repeated uint32 repeated_uint32 = 92 [packed = true]; + */ public function setRepeatedUint32(&$var) { GPBUtil::checkRepeatedField($var, GPBType::UINT32); $this->repeated_uint32 = $var; } + /** + * repeated uint64 repeated_uint64 = 93 [packed = true]; + */ public function getRepeatedUint64() { return $this->repeated_uint64; } + /** + * repeated uint64 repeated_uint64 = 93 [packed = true]; + */ public function setRepeatedUint64(&$var) { GPBUtil::checkRepeatedField($var, GPBType::UINT64); $this->repeated_uint64 = $var; } + /** + * repeated sint32 repeated_sint32 = 94 [packed = true]; + */ public function getRepeatedSint32() { return $this->repeated_sint32; } + /** + * repeated sint32 repeated_sint32 = 94 [packed = true]; + */ public function setRepeatedSint32(&$var) { GPBUtil::checkRepeatedField($var, GPBType::SINT32); $this->repeated_sint32 = $var; } + /** + * repeated sint64 repeated_sint64 = 95 [packed = true]; + */ public function getRepeatedSint64() { return $this->repeated_sint64; } + /** + * repeated sint64 repeated_sint64 = 95 [packed = true]; + */ public function setRepeatedSint64(&$var) { GPBUtil::checkRepeatedField($var, GPBType::SINT64); $this->repeated_sint64 = $var; } + /** + * repeated fixed32 repeated_fixed32 = 96 [packed = true]; + */ public function getRepeatedFixed32() { return $this->repeated_fixed32; } + /** + * repeated fixed32 repeated_fixed32 = 96 [packed = true]; + */ public function setRepeatedFixed32(&$var) { GPBUtil::checkRepeatedField($var, GPBType::FIXED32); $this->repeated_fixed32 = $var; } + /** + * repeated fixed64 repeated_fixed64 = 97 [packed = true]; + */ public function getRepeatedFixed64() { return $this->repeated_fixed64; } + /** + * repeated fixed64 repeated_fixed64 = 97 [packed = true]; + */ public function setRepeatedFixed64(&$var) { GPBUtil::checkRepeatedField($var, GPBType::FIXED64); $this->repeated_fixed64 = $var; } + /** + * repeated sfixed32 repeated_sfixed32 = 98 [packed = true]; + */ public function getRepeatedSfixed32() { return $this->repeated_sfixed32; } + /** + * repeated sfixed32 repeated_sfixed32 = 98 [packed = true]; + */ public function setRepeatedSfixed32(&$var) { GPBUtil::checkRepeatedField($var, GPBType::SFIXED32); $this->repeated_sfixed32 = $var; } + /** + * repeated sfixed64 repeated_sfixed64 = 99 [packed = true]; + */ public function getRepeatedSfixed64() { return $this->repeated_sfixed64; } + /** + * repeated sfixed64 repeated_sfixed64 = 99 [packed = true]; + */ public function setRepeatedSfixed64(&$var) { GPBUtil::checkRepeatedField($var, GPBType::SFIXED64); $this->repeated_sfixed64 = $var; } + /** + * repeated float repeated_float = 100 [packed = true]; + */ public function getRepeatedFloat() { return $this->repeated_float; } + /** + * repeated float repeated_float = 100 [packed = true]; + */ public function setRepeatedFloat(&$var) { GPBUtil::checkRepeatedField($var, GPBType::FLOAT); $this->repeated_float = $var; } + /** + * repeated double repeated_double = 101 [packed = true]; + */ public function getRepeatedDouble() { return $this->repeated_double; } + /** + * repeated double repeated_double = 101 [packed = true]; + */ public function setRepeatedDouble(&$var) { GPBUtil::checkRepeatedField($var, GPBType::DOUBLE); $this->repeated_double = $var; } + /** + * repeated bool repeated_bool = 102 [packed = true]; + */ public function getRepeatedBool() { return $this->repeated_bool; } + /** + * repeated bool repeated_bool = 102 [packed = true]; + */ public function setRepeatedBool(&$var) { GPBUtil::checkRepeatedField($var, GPBType::BOOL); $this->repeated_bool = $var; } + /** + * repeated .foo.TestEnum repeated_enum = 103 [packed = true]; + */ public function getRepeatedEnum() { return $this->repeated_enum; } + /** + * repeated .foo.TestEnum repeated_enum = 103 [packed = true]; + */ public function setRepeatedEnum(&$var) { GPBUtil::checkRepeatedField($var, GPBType::ENUM, Foo\TestEnum::class); @@ -1040,171 +1805,304 @@ class TestPackedMessage extends \Google\Protobuf\Internal\Message } +/** + *
+ * Need to be in sync with TestPackedMessage.
+ * 
+ * + * Protobuf type foo.TestUnpackedMessage + */ class TestUnpackedMessage extends \Google\Protobuf\Internal\Message { + /** + * repeated int32 repeated_int32 = 90 [packed = false]; + */ private $repeated_int32; + /** + * repeated int64 repeated_int64 = 91 [packed = false]; + */ private $repeated_int64; + /** + * repeated uint32 repeated_uint32 = 92 [packed = false]; + */ private $repeated_uint32; + /** + * repeated uint64 repeated_uint64 = 93 [packed = false]; + */ private $repeated_uint64; + /** + * repeated sint32 repeated_sint32 = 94 [packed = false]; + */ private $repeated_sint32; + /** + * repeated sint64 repeated_sint64 = 95 [packed = false]; + */ private $repeated_sint64; + /** + * repeated fixed32 repeated_fixed32 = 96 [packed = false]; + */ private $repeated_fixed32; + /** + * repeated fixed64 repeated_fixed64 = 97 [packed = false]; + */ private $repeated_fixed64; + /** + * repeated sfixed32 repeated_sfixed32 = 98 [packed = false]; + */ private $repeated_sfixed32; + /** + * repeated sfixed64 repeated_sfixed64 = 99 [packed = false]; + */ private $repeated_sfixed64; + /** + * repeated float repeated_float = 100 [packed = false]; + */ private $repeated_float; + /** + * repeated double repeated_double = 101 [packed = false]; + */ private $repeated_double; + /** + * repeated bool repeated_bool = 102 [packed = false]; + */ private $repeated_bool; + /** + * repeated .foo.TestEnum repeated_enum = 103 [packed = false]; + */ private $repeated_enum; + /** + * repeated int32 repeated_int32 = 90 [packed = false]; + */ public function getRepeatedInt32() { return $this->repeated_int32; } + /** + * repeated int32 repeated_int32 = 90 [packed = false]; + */ public function setRepeatedInt32(&$var) { GPBUtil::checkRepeatedField($var, GPBType::INT32); $this->repeated_int32 = $var; } + /** + * repeated int64 repeated_int64 = 91 [packed = false]; + */ public function getRepeatedInt64() { return $this->repeated_int64; } + /** + * repeated int64 repeated_int64 = 91 [packed = false]; + */ public function setRepeatedInt64(&$var) { GPBUtil::checkRepeatedField($var, GPBType::INT64); $this->repeated_int64 = $var; } + /** + * repeated uint32 repeated_uint32 = 92 [packed = false]; + */ public function getRepeatedUint32() { return $this->repeated_uint32; } + /** + * repeated uint32 repeated_uint32 = 92 [packed = false]; + */ public function setRepeatedUint32(&$var) { GPBUtil::checkRepeatedField($var, GPBType::UINT32); $this->repeated_uint32 = $var; } + /** + * repeated uint64 repeated_uint64 = 93 [packed = false]; + */ public function getRepeatedUint64() { return $this->repeated_uint64; } + /** + * repeated uint64 repeated_uint64 = 93 [packed = false]; + */ public function setRepeatedUint64(&$var) { GPBUtil::checkRepeatedField($var, GPBType::UINT64); $this->repeated_uint64 = $var; } + /** + * repeated sint32 repeated_sint32 = 94 [packed = false]; + */ public function getRepeatedSint32() { return $this->repeated_sint32; } + /** + * repeated sint32 repeated_sint32 = 94 [packed = false]; + */ public function setRepeatedSint32(&$var) { GPBUtil::checkRepeatedField($var, GPBType::SINT32); $this->repeated_sint32 = $var; } + /** + * repeated sint64 repeated_sint64 = 95 [packed = false]; + */ public function getRepeatedSint64() { return $this->repeated_sint64; } + /** + * repeated sint64 repeated_sint64 = 95 [packed = false]; + */ public function setRepeatedSint64(&$var) { GPBUtil::checkRepeatedField($var, GPBType::SINT64); $this->repeated_sint64 = $var; } + /** + * repeated fixed32 repeated_fixed32 = 96 [packed = false]; + */ public function getRepeatedFixed32() { return $this->repeated_fixed32; } + /** + * repeated fixed32 repeated_fixed32 = 96 [packed = false]; + */ public function setRepeatedFixed32(&$var) { GPBUtil::checkRepeatedField($var, GPBType::FIXED32); $this->repeated_fixed32 = $var; } + /** + * repeated fixed64 repeated_fixed64 = 97 [packed = false]; + */ public function getRepeatedFixed64() { return $this->repeated_fixed64; } + /** + * repeated fixed64 repeated_fixed64 = 97 [packed = false]; + */ public function setRepeatedFixed64(&$var) { GPBUtil::checkRepeatedField($var, GPBType::FIXED64); $this->repeated_fixed64 = $var; } + /** + * repeated sfixed32 repeated_sfixed32 = 98 [packed = false]; + */ public function getRepeatedSfixed32() { return $this->repeated_sfixed32; } + /** + * repeated sfixed32 repeated_sfixed32 = 98 [packed = false]; + */ public function setRepeatedSfixed32(&$var) { GPBUtil::checkRepeatedField($var, GPBType::SFIXED32); $this->repeated_sfixed32 = $var; } + /** + * repeated sfixed64 repeated_sfixed64 = 99 [packed = false]; + */ public function getRepeatedSfixed64() { return $this->repeated_sfixed64; } + /** + * repeated sfixed64 repeated_sfixed64 = 99 [packed = false]; + */ public function setRepeatedSfixed64(&$var) { GPBUtil::checkRepeatedField($var, GPBType::SFIXED64); $this->repeated_sfixed64 = $var; } + /** + * repeated float repeated_float = 100 [packed = false]; + */ public function getRepeatedFloat() { return $this->repeated_float; } + /** + * repeated float repeated_float = 100 [packed = false]; + */ public function setRepeatedFloat(&$var) { GPBUtil::checkRepeatedField($var, GPBType::FLOAT); $this->repeated_float = $var; } + /** + * repeated double repeated_double = 101 [packed = false]; + */ public function getRepeatedDouble() { return $this->repeated_double; } + /** + * repeated double repeated_double = 101 [packed = false]; + */ public function setRepeatedDouble(&$var) { GPBUtil::checkRepeatedField($var, GPBType::DOUBLE); $this->repeated_double = $var; } + /** + * repeated bool repeated_bool = 102 [packed = false]; + */ public function getRepeatedBool() { return $this->repeated_bool; } + /** + * repeated bool repeated_bool = 102 [packed = false]; + */ public function setRepeatedBool(&$var) { GPBUtil::checkRepeatedField($var, GPBType::BOOL); $this->repeated_bool = $var; } + /** + * repeated .foo.TestEnum repeated_enum = 103 [packed = false]; + */ public function getRepeatedEnum() { return $this->repeated_enum; } + /** + * repeated .foo.TestEnum repeated_enum = 103 [packed = false]; + */ public function setRepeatedEnum(&$var) { GPBUtil::checkRepeatedField($var, GPBType::ENUM, Foo\TestEnum::class); @@ -1213,16 +2111,58 @@ class TestUnpackedMessage extends \Google\Protobuf\Internal\Message } +/** + *
+ * /**/@<>&\{
+ * 
+ * + * Protobuf type foo.TestPhpDoc + */ +class TestPhpDoc extends \Google\Protobuf\Internal\Message +{ + /** + * optional int32 a = 1; + */ + private $a = 0; + + /** + * optional int32 a = 1; + */ + public function getA() + { + return $this->a; + } + + /** + * optional int32 a = 1; + */ + public function setA($var) + { + GPBUtil::checkInt32($var); + $this->a = $var; + } + +} + +/** + * Protobuf enum foo.TestEnum + */ class TestEnum { + /** + * ZERO = 0; + */ const ZERO = 0; + /** + * ONE = 1; + */ const ONE = 1; } $pool = DescriptorPool::getGeneratedPool(); $pool->internalAddGeneratedFile(hex2bin( - "0a83250a0a746573742e70726f746f1203666f6f1a12746573745f696e63" . + "0a9c250a0a746573742e70726f746f1203666f6f1a12746573745f696e63" . "6c7564652e70726f746f22be1d0a0b546573744d65737361676512160a0e" . "6f7074696f6e616c5f696e74333218012001280512160a0e6f7074696f6e" . "616c5f696e74363418022001280312170a0f6f7074696f6e616c5f75696e" . @@ -1378,8 +2318,8 @@ $pool->internalAddGeneratedFile(hex2bin( "666c6f617418642003280242021000121b0a0f72657065617465645f646f" . "75626c651865200328014202100012190a0d72657065617465645f626f6f" . "6c1866200328084202100012280a0d72657065617465645f656e756d1867" . - "2003280e320d2e666f6f2e54657374456e756d420210002a1d0a08546573" . - "74456e756d12080a045a45524f100012070a034f4e451001620670726f74" . - "6f33" + "2003280e320d2e666f6f2e54657374456e756d4202100022170a0a546573" . + "74506870446f6312090a01611801200128052a1d0a0854657374456e756d" . + "12080a045a45524f100012070a034f4e451001620670726f746f33" )); diff --git a/php/tests/test.proto b/php/tests/test.proto index 15709c83..f15f6297 100644 --- a/php/tests/test.proto +++ b/php/tests/test.proto @@ -134,3 +134,8 @@ message TestUnpackedMessage { repeated bool repeated_bool = 102 [packed = false]; repeated TestEnum repeated_enum = 103 [packed = false]; } + +// /**/@<>&\{ +message TestPhpDoc { + int32 a = 1; +} diff --git a/php/tests/test_include.pb.php b/php/tests/test_include.pb.php index 2c43cc41..11ff59cb 100644 --- a/php/tests/test_include.pb.php +++ b/php/tests/test_include.pb.php @@ -9,15 +9,27 @@ use Google\Protobuf\Internal\GPBType; use Google\Protobuf\Internal\RepeatedField; use Google\Protobuf\Internal\GPBUtil; +/** + * Protobuf type bar.TestInclude + */ class TestInclude extends \Google\Protobuf\Internal\Message { + /** + * optional int32 a = 1; + */ private $a = 0; + /** + * optional int32 a = 1; + */ public function getA() { return $this->a; } + /** + * optional int32 a = 1; + */ public function setA($var) { GPBUtil::checkInt32($var); -- cgit v1.2.3