Merge commit '36bca61764984ff5395653cf8377ec5daa71b709' as 'libs/protobuf'
This commit is contained in:
17
libs/protobuf/php/tests/proto/empty/echo.proto
Normal file
17
libs/protobuf/php/tests/proto/empty/echo.proto
Normal file
@@ -0,0 +1,17 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package empty.echo;
|
||||
|
||||
message TestEmptyPackage {
|
||||
int32 a = 1;
|
||||
|
||||
// Test nested messages, enums, and reserved names
|
||||
NestedMessage nested_message = 2;
|
||||
NestedEnum nested_enum = 3;
|
||||
message NestedMessage {
|
||||
int32 a = 1;
|
||||
}
|
||||
enum NestedEnum {
|
||||
ZERO = 0;
|
||||
};
|
||||
}
|
||||
347
libs/protobuf/php/tests/proto/test.proto
Normal file
347
libs/protobuf/php/tests/proto/test.proto
Normal file
@@ -0,0 +1,347 @@
|
||||
syntax = "proto3";
|
||||
|
||||
import 'google/protobuf/any.proto';
|
||||
import 'google/protobuf/wrappers.proto';
|
||||
import 'google/protobuf/struct.proto';
|
||||
import 'proto/test_include.proto';
|
||||
import 'proto/test_no_namespace.proto';
|
||||
import 'proto/test_php_namespace.proto';
|
||||
import 'proto/test_empty_php_namespace.proto';
|
||||
import 'proto/test_prefix.proto';
|
||||
|
||||
package foo;
|
||||
|
||||
message TestMessage {
|
||||
// Singular
|
||||
int32 optional_int32 = 1;
|
||||
int64 optional_int64 = 2;
|
||||
uint32 optional_uint32 = 3;
|
||||
uint64 optional_uint64 = 4;
|
||||
sint32 optional_sint32 = 5;
|
||||
sint64 optional_sint64 = 6;
|
||||
fixed32 optional_fixed32 = 7;
|
||||
fixed64 optional_fixed64 = 8;
|
||||
sfixed32 optional_sfixed32 = 9;
|
||||
sfixed64 optional_sfixed64 = 10;
|
||||
float optional_float = 11;
|
||||
double optional_double = 12;
|
||||
bool optional_bool = 13;
|
||||
string optional_string = 14;
|
||||
bytes optional_bytes = 15;
|
||||
|
||||
TestEnum optional_enum = 16;
|
||||
Sub optional_message = 17;
|
||||
bar.TestInclude optional_included_message = 18;
|
||||
TestMessage recursive = 19;
|
||||
|
||||
// True optional
|
||||
optional int32 true_optional_int32 = 201;
|
||||
optional int64 true_optional_int64 = 202;
|
||||
optional uint32 true_optional_uint32 = 203;
|
||||
optional uint64 true_optional_uint64 = 204;
|
||||
optional sint32 true_optional_sint32 = 205;
|
||||
optional sint64 true_optional_sint64 = 206;
|
||||
optional fixed32 true_optional_fixed32 = 207;
|
||||
optional fixed64 true_optional_fixed64 = 208;
|
||||
optional sfixed32 true_optional_sfixed32 = 209;
|
||||
optional sfixed64 true_optional_sfixed64 = 210;
|
||||
optional float true_optional_float = 211;
|
||||
optional double true_optional_double = 212;
|
||||
optional bool true_optional_bool = 213;
|
||||
optional string true_optional_string = 214;
|
||||
optional bytes true_optional_bytes = 215;
|
||||
|
||||
optional TestEnum true_optional_enum = 216;
|
||||
optional Sub true_optional_message = 217;
|
||||
optional bar.TestInclude true_optional_included_message = 218;
|
||||
|
||||
// Repeated
|
||||
repeated int32 repeated_int32 = 31;
|
||||
repeated int64 repeated_int64 = 32;
|
||||
repeated uint32 repeated_uint32 = 33;
|
||||
repeated uint64 repeated_uint64 = 34;
|
||||
repeated sint32 repeated_sint32 = 35;
|
||||
repeated sint64 repeated_sint64 = 36;
|
||||
repeated fixed32 repeated_fixed32 = 37;
|
||||
repeated fixed64 repeated_fixed64 = 38;
|
||||
repeated sfixed32 repeated_sfixed32 = 39;
|
||||
repeated sfixed64 repeated_sfixed64 = 40;
|
||||
repeated float repeated_float = 41;
|
||||
repeated double repeated_double = 42;
|
||||
repeated bool repeated_bool = 43;
|
||||
repeated string repeated_string = 44;
|
||||
repeated bytes repeated_bytes = 45;
|
||||
|
||||
repeated TestEnum repeated_enum = 46;
|
||||
repeated Sub repeated_message = 47;
|
||||
repeated TestMessage repeated_recursive = 48;
|
||||
|
||||
oneof my_oneof {
|
||||
int32 oneof_int32 = 51;
|
||||
int64 oneof_int64 = 52;
|
||||
uint32 oneof_uint32 = 53;
|
||||
uint64 oneof_uint64 = 54;
|
||||
uint32 oneof_sint32 = 55;
|
||||
uint64 oneof_sint64 = 56;
|
||||
uint32 oneof_fixed32 = 57;
|
||||
uint64 oneof_fixed64 = 58;
|
||||
uint32 oneof_sfixed32 = 59;
|
||||
uint64 oneof_sfixed64 = 60;
|
||||
double oneof_double = 61;
|
||||
float oneof_float = 62;
|
||||
bool oneof_bool = 63;
|
||||
string oneof_string = 64;
|
||||
bytes oneof_bytes = 65;
|
||||
TestEnum oneof_enum = 66;
|
||||
Sub oneof_message = 67;
|
||||
}
|
||||
|
||||
map<int32, int32> map_int32_int32 = 71;
|
||||
map<int64, int64> map_int64_int64 = 72;
|
||||
map<uint32, uint32> map_uint32_uint32 = 73;
|
||||
map<uint64, uint64> map_uint64_uint64 = 74;
|
||||
map<sint32, sint32> map_sint32_sint32 = 75;
|
||||
map<sint64, sint64> map_sint64_sint64 = 76;
|
||||
map<fixed32, fixed32> map_fixed32_fixed32 = 77;
|
||||
map<fixed64, fixed64> map_fixed64_fixed64 = 78;
|
||||
map<sfixed32, sfixed32> map_sfixed32_sfixed32 = 79;
|
||||
map<sfixed64, sfixed64> map_sfixed64_sfixed64 = 80;
|
||||
map<int32, float> map_int32_float = 81;
|
||||
map<int32, double> map_int32_double = 82;
|
||||
map<bool, bool> map_bool_bool = 83;
|
||||
map<string, string> map_string_string = 84;
|
||||
map<int32, bytes> map_int32_bytes = 85;
|
||||
map<int32, TestEnum> map_int32_enum = 86;
|
||||
map<int32, Sub> map_int32_message = 87;
|
||||
|
||||
map<int32, TestMessage> map_recursive = 88;
|
||||
|
||||
message Sub {
|
||||
int32 a = 1;
|
||||
repeated int32 b = 2;
|
||||
}
|
||||
|
||||
// Reserved for non-existing field test.
|
||||
// int32 non_exist = 89;
|
||||
|
||||
NoNamespaceMessage optional_no_namespace_message = 91;
|
||||
NoNamespaceEnum optional_no_namespace_enum = 92;
|
||||
repeated NoNamespaceMessage repeated_no_namespace_message = 93;
|
||||
repeated NoNamespaceEnum repeated_no_namespace_enum = 94;
|
||||
|
||||
enum NestedEnum {
|
||||
ZERO = 0;
|
||||
}
|
||||
|
||||
NestedEnum optional_nested_enum = 101;
|
||||
|
||||
// Test prefix for reserved words.
|
||||
message Empty {
|
||||
int32 a = 1;
|
||||
}
|
||||
|
||||
reserved 111;
|
||||
|
||||
// Test map with missing message value
|
||||
map<string, TestMessage> map_string_message = 121;
|
||||
map<string, google.protobuf.Any> map_string_any = 122;
|
||||
map<string, google.protobuf.ListValue> map_string_list = 123;
|
||||
map<string, google.protobuf.Struct> map_string_struct = 124;
|
||||
|
||||
// deprecated field
|
||||
int32 deprecated_optional_int32 = 125 [deprecated=true];
|
||||
}
|
||||
|
||||
enum TestEnum {
|
||||
ZERO = 0;
|
||||
ONE = 1;
|
||||
TWO = 2;
|
||||
ECHO = 3; // Test reserved name.
|
||||
}
|
||||
|
||||
// Test prefix for reserved words.
|
||||
message Empty {
|
||||
int32 a = 1;
|
||||
}
|
||||
|
||||
message ARRAY {
|
||||
int32 a = 1;
|
||||
}
|
||||
|
||||
message EmptyAnySerialization {
|
||||
string a = 1;
|
||||
}
|
||||
|
||||
message TestPackedMessage {
|
||||
repeated int32 repeated_int32 = 90 [packed = true];
|
||||
repeated int64 repeated_int64 = 91 [packed = true];
|
||||
repeated uint32 repeated_uint32 = 92 [packed = true];
|
||||
repeated uint64 repeated_uint64 = 93 [packed = true];
|
||||
repeated sint32 repeated_sint32 = 94 [packed = true];
|
||||
repeated sint64 repeated_sint64 = 95 [packed = true];
|
||||
repeated fixed32 repeated_fixed32 = 96 [packed = true];
|
||||
repeated fixed64 repeated_fixed64 = 97 [packed = true];
|
||||
repeated sfixed32 repeated_sfixed32 = 98 [packed = true];
|
||||
repeated sfixed64 repeated_sfixed64 = 99 [packed = true];
|
||||
repeated float repeated_float = 100 [packed = true];
|
||||
repeated double repeated_double = 101 [packed = true];
|
||||
repeated bool repeated_bool = 102 [packed = true];
|
||||
repeated TestEnum repeated_enum = 103 [packed = true];
|
||||
}
|
||||
|
||||
// Need to be in sync with TestPackedMessage.
|
||||
message TestUnpackedMessage {
|
||||
repeated int32 repeated_int32 = 90 [packed = false];
|
||||
repeated int64 repeated_int64 = 91 [packed = false];
|
||||
repeated uint32 repeated_uint32 = 92 [packed = false];
|
||||
repeated uint64 repeated_uint64 = 93 [packed = false];
|
||||
repeated sint32 repeated_sint32 = 94 [packed = false];
|
||||
repeated sint64 repeated_sint64 = 95 [packed = false];
|
||||
repeated fixed32 repeated_fixed32 = 96 [packed = false];
|
||||
repeated fixed64 repeated_fixed64 = 97 [packed = false];
|
||||
repeated sfixed32 repeated_sfixed32 = 98 [packed = false];
|
||||
repeated sfixed64 repeated_sfixed64 = 99 [packed = false];
|
||||
repeated float repeated_float = 100 [packed = false];
|
||||
repeated double repeated_double = 101 [packed = false];
|
||||
repeated bool repeated_bool = 102 [packed = false];
|
||||
repeated TestEnum repeated_enum = 103 [packed = false];
|
||||
}
|
||||
|
||||
// /**/@<>&\{
|
||||
message TestPhpDoc {
|
||||
int32 a = 1;
|
||||
}
|
||||
|
||||
message TestIncludePrefixMessage {
|
||||
TestPrefix prefix_message = 1;
|
||||
}
|
||||
|
||||
message TestIncludeNamespaceMessage {
|
||||
TestNamespace namespace_message = 1;
|
||||
TestEmptyNamespace empty_namespace_message = 2;
|
||||
}
|
||||
|
||||
// This will cause upb fields not ordered by the order in the generated code.
|
||||
message TestRandomFieldOrder {
|
||||
int64 tag13 = 150;
|
||||
string tag14 = 160;
|
||||
}
|
||||
|
||||
message TestLargeFieldNumber {
|
||||
int32 large_field_number = 536870911;
|
||||
}
|
||||
|
||||
message TestReverseFieldOrder {
|
||||
repeated int32 a = 2;
|
||||
string b = 1;
|
||||
}
|
||||
|
||||
message testLowerCaseMessage {
|
||||
}
|
||||
|
||||
enum testLowerCaseEnum {
|
||||
VALUE = 0;
|
||||
}
|
||||
|
||||
message TestAny {
|
||||
google.protobuf.Any any = 1;
|
||||
}
|
||||
|
||||
message TestInt32Value {
|
||||
google.protobuf.Int32Value field = 1;
|
||||
repeated google.protobuf.Int32Value repeated_field = 2;
|
||||
oneof oneof_fields {
|
||||
google.protobuf.Int32Value oneof_field = 3;
|
||||
int32 int32_field = 4;
|
||||
}
|
||||
}
|
||||
|
||||
message TestInt64Value {
|
||||
google.protobuf.Int64Value field = 1;
|
||||
repeated google.protobuf.Int64Value repeated_field = 2;
|
||||
oneof oneof_fields {
|
||||
google.protobuf.Int64Value oneof_field = 3;
|
||||
int32 int32_field = 4;
|
||||
}
|
||||
}
|
||||
|
||||
message TestUInt32Value {
|
||||
google.protobuf.UInt32Value field = 1;
|
||||
repeated google.protobuf.UInt32Value repeated_field = 2;
|
||||
oneof oneof_fields {
|
||||
google.protobuf.UInt32Value oneof_field = 3;
|
||||
int32 int32_field = 4;
|
||||
}
|
||||
}
|
||||
|
||||
message TestUInt64Value {
|
||||
google.protobuf.UInt64Value field = 1;
|
||||
repeated google.protobuf.UInt64Value repeated_field = 2;
|
||||
oneof oneof_fields {
|
||||
google.protobuf.UInt64Value oneof_field = 3;
|
||||
int32 int32_field = 4;
|
||||
}
|
||||
}
|
||||
|
||||
message TestBoolValue {
|
||||
google.protobuf.BoolValue field = 1;
|
||||
repeated google.protobuf.BoolValue repeated_field = 2;
|
||||
oneof oneof_fields {
|
||||
google.protobuf.BoolValue oneof_field = 3;
|
||||
int32 int32_field = 4;
|
||||
}
|
||||
}
|
||||
|
||||
message TestStringValue {
|
||||
google.protobuf.StringValue field = 1;
|
||||
repeated google.protobuf.StringValue repeated_field = 2;
|
||||
oneof oneof_fields {
|
||||
google.protobuf.StringValue oneof_field = 3;
|
||||
int32 int32_field = 4;
|
||||
}
|
||||
map<int32, google.protobuf.StringValue> map_field = 5;
|
||||
}
|
||||
|
||||
message TestBytesValue {
|
||||
google.protobuf.BytesValue field = 1;
|
||||
repeated google.protobuf.BytesValue repeated_field = 2;
|
||||
oneof oneof_fields {
|
||||
google.protobuf.BytesValue oneof_field = 3;
|
||||
int32 int32_field = 4;
|
||||
}
|
||||
}
|
||||
|
||||
message Test32Fields {
|
||||
optional uint32 id = 1;
|
||||
optional uint32 random_name_a0 = 2;
|
||||
optional uint32 random_name_a1 = 3;
|
||||
optional uint32 random_name_a2 = 4;
|
||||
optional uint32 random_name_a3 = 5;
|
||||
optional uint32 random_name_a4 = 6;
|
||||
optional uint32 random_name_a5 = 7;
|
||||
optional uint32 random_name_a6 = 8;
|
||||
optional uint32 random_name_a7 = 9;
|
||||
optional uint32 random_name_a8 = 10;
|
||||
optional uint32 random_name_a9 = 11;
|
||||
optional uint32 random_name_b0 = 12;
|
||||
optional uint32 random_name_b1 = 13;
|
||||
optional uint32 random_name_b2 = 14;
|
||||
optional uint32 random_name_b3 = 15;
|
||||
optional uint32 random_name_b4 = 16;
|
||||
optional uint32 random_name_b5 = 17;
|
||||
optional uint32 random_name_b6 = 18;
|
||||
optional uint32 random_name_b7 = 19;
|
||||
optional uint32 random_name_b8 = 20;
|
||||
optional uint32 random_name_b9 = 21;
|
||||
optional uint32 random_name_c0 = 22;
|
||||
optional uint32 random_name_c1 = 23;
|
||||
optional uint32 random_name_c2 = 24;
|
||||
optional uint32 random_name_c3 = 25;
|
||||
optional uint32 random_name_c4 = 26;
|
||||
optional uint32 random_name_c5 = 27;
|
||||
optional uint32 random_name_c6 = 28;
|
||||
optional uint32 random_name_c7 = 29;
|
||||
optional uint32 random_name_c8 = 30;
|
||||
optional uint32 random_name_c9 = 31;
|
||||
optional string version = 32;
|
||||
}
|
||||
36
libs/protobuf/php/tests/proto/test_descriptors.proto
Normal file
36
libs/protobuf/php/tests/proto/test_descriptors.proto
Normal file
@@ -0,0 +1,36 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package descriptors;
|
||||
|
||||
message TestDescriptorsMessage {
|
||||
int32 optional_int32 = 1;
|
||||
TestDescriptorsEnum optional_enum = 16;
|
||||
Sub optional_message = 17;
|
||||
|
||||
// Repeated
|
||||
repeated int32 repeated_int32 = 31;
|
||||
repeated Sub repeated_message = 47;
|
||||
|
||||
oneof my_oneof {
|
||||
int32 oneof_int32 = 51;
|
||||
}
|
||||
optional int32 proto3_optional_int32 = 52;
|
||||
|
||||
map<int32, EnumSub> map_int32_enum = 71;
|
||||
|
||||
message Sub {
|
||||
int32 a = 1;
|
||||
repeated int32 b = 2;
|
||||
}
|
||||
|
||||
enum EnumSub {
|
||||
ZERO = 0;
|
||||
ONE = 1;
|
||||
}
|
||||
}
|
||||
|
||||
enum TestDescriptorsEnum {
|
||||
ZERO = 0;
|
||||
ONE = 1;
|
||||
}
|
||||
|
||||
19
libs/protobuf/php/tests/proto/test_empty_php_namespace.proto
Normal file
19
libs/protobuf/php/tests/proto/test_empty_php_namespace.proto
Normal file
@@ -0,0 +1,19 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package foo;
|
||||
option php_namespace = "";
|
||||
option php_metadata_namespace = "";
|
||||
|
||||
message TestEmptyNamespace {
|
||||
int32 a = 1;
|
||||
|
||||
// Test nested messages, enums, and reserved names
|
||||
NestedMessage nested_message = 2;
|
||||
NestedEnum nested_enum = 3;
|
||||
message NestedMessage {
|
||||
int32 a = 1;
|
||||
}
|
||||
enum NestedEnum {
|
||||
ZERO = 0;
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package foo;
|
||||
|
||||
import "google/protobuf/descriptor.proto";
|
||||
|
||||
message TestImportDescriptorProto {
|
||||
extend google.protobuf.MethodOptions {
|
||||
int32 a = 72295727;
|
||||
}
|
||||
}
|
||||
|
||||
extend google.protobuf.MethodOptions {
|
||||
int32 a = 72295728;
|
||||
}
|
||||
|
||||
18
libs/protobuf/php/tests/proto/test_include.proto
Normal file
18
libs/protobuf/php/tests/proto/test_include.proto
Normal file
@@ -0,0 +1,18 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package bar;
|
||||
|
||||
message TestInclude {
|
||||
int32 a = 1;
|
||||
}
|
||||
|
||||
message TestLegacyMessage {
|
||||
NestedMessage message = 1;
|
||||
NestedEnum enum = 2;
|
||||
message NestedMessage {
|
||||
int32 a = 1;
|
||||
}
|
||||
enum NestedEnum {
|
||||
ZERO = 0;
|
||||
}
|
||||
}
|
||||
22
libs/protobuf/php/tests/proto/test_no_namespace.proto
Normal file
22
libs/protobuf/php/tests/proto/test_no_namespace.proto
Normal file
@@ -0,0 +1,22 @@
|
||||
syntax = "proto3";
|
||||
|
||||
option php_metadata_namespace = "\\";
|
||||
|
||||
message NoNamespaceMessage {
|
||||
int32 a = 1;
|
||||
|
||||
// Test nested messages, enums, and reserved names
|
||||
NestedMessage nested_message = 2;
|
||||
NestedEnum nested_enum = 3;
|
||||
message NestedMessage {
|
||||
int32 a = 1;
|
||||
}
|
||||
enum NestedEnum {
|
||||
ZERO = 0;
|
||||
};
|
||||
}
|
||||
|
||||
enum NoNamespaceEnum {
|
||||
VALUE_A = 0;
|
||||
VALUE_B = 1;
|
||||
}
|
||||
33
libs/protobuf/php/tests/proto/test_php_namespace.proto
Normal file
33
libs/protobuf/php/tests/proto/test_php_namespace.proto
Normal file
@@ -0,0 +1,33 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package foo;
|
||||
option php_namespace = "Php\\Test";
|
||||
option php_metadata_namespace = "Metadata\\Php\\Test";
|
||||
|
||||
message TestNamespace {
|
||||
int32 a = 1;
|
||||
|
||||
// Test nested messages, enums, and reserved names
|
||||
NestedMessage nested_message = 2;
|
||||
NestedEnum nested_enum = 3;
|
||||
Empty reserved_name = 4;
|
||||
message NestedMessage {
|
||||
int32 a = 1;
|
||||
}
|
||||
enum NestedEnum {
|
||||
ZERO = 0;
|
||||
};
|
||||
// Test reserved name
|
||||
message Empty {
|
||||
NestedMessage nested_message = 1;
|
||||
NestedEnum nested_enum = 2;
|
||||
message NestedMessage {
|
||||
int32 a = 1;
|
||||
}
|
||||
enum NestedEnum {
|
||||
ZERO = 0;
|
||||
};
|
||||
// Test previously unreserved name
|
||||
message ReadOnly {}
|
||||
}
|
||||
}
|
||||
20
libs/protobuf/php/tests/proto/test_prefix.proto
Normal file
20
libs/protobuf/php/tests/proto/test_prefix.proto
Normal file
@@ -0,0 +1,20 @@
|
||||
syntax = "proto3";
|
||||
|
||||
option php_class_prefix = "Prefix";
|
||||
|
||||
message TestPrefix {
|
||||
int32 a = 1;
|
||||
NestedMessage nested_message = 2;
|
||||
NestedEnum nested_enum = 3;
|
||||
message NestedMessage {
|
||||
int32 a = 1;
|
||||
}
|
||||
enum NestedEnum {
|
||||
ZERO = 0;
|
||||
};
|
||||
}
|
||||
|
||||
// Test prefix for reserved words.
|
||||
message Empty {
|
||||
int32 a = 1;
|
||||
}
|
||||
84
libs/protobuf/php/tests/proto/test_reserved_enum_lower.proto
Normal file
84
libs/protobuf/php/tests/proto/test_reserved_enum_lower.proto
Normal file
@@ -0,0 +1,84 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package lower_enum;
|
||||
|
||||
enum abstract { ZERO1 = 0; }
|
||||
enum and { ZERO2 = 0; }
|
||||
enum array { ZERO3 = 0; }
|
||||
enum as { ZERO4 = 0; }
|
||||
enum break { ZERO5 = 0; }
|
||||
enum callable { ZERO6 = 0; }
|
||||
enum case { ZERO7 = 0; }
|
||||
enum catch { ZERO8 = 0; }
|
||||
enum class { ZERO9 = 0; }
|
||||
enum clone { ZERO10 = 0; }
|
||||
enum const { ZERO11 = 0; }
|
||||
enum continue { ZERO12 = 0; }
|
||||
enum declare { ZERO13 = 0; }
|
||||
enum default { ZERO14 = 0; }
|
||||
enum die { ZERO15 = 0; }
|
||||
enum do { ZERO16 = 0; }
|
||||
enum echo { ZERO17 = 0; }
|
||||
enum else { ZERO18 = 0; }
|
||||
enum elseif { ZERO19 = 0; }
|
||||
enum empty { ZERO20 = 0; }
|
||||
enum enddeclare { ZERO21 = 0; }
|
||||
enum endfor { ZERO22 = 0; }
|
||||
enum endforeach { ZERO23 = 0; }
|
||||
enum endif { ZERO24 = 0; }
|
||||
enum endswitch { ZERO25 = 0; }
|
||||
enum endwhile { ZERO26 = 0; }
|
||||
enum eval { ZERO27 = 0; }
|
||||
enum exit { ZERO28 = 0; }
|
||||
enum extends { ZERO29 = 0; }
|
||||
enum final { ZERO30 = 0; }
|
||||
enum finally { ZERO31 = 0; }
|
||||
enum fn { ZERO32 = 0; }
|
||||
enum for { ZERO33 = 0; }
|
||||
enum foreach { ZERO34 = 0; }
|
||||
enum function { ZERO35 = 0; }
|
||||
enum global { ZERO36 = 0; }
|
||||
enum goto { ZERO37 = 0; }
|
||||
enum if { ZERO38 = 0; }
|
||||
enum implements { ZERO39 = 0; }
|
||||
enum include { ZERO40 = 0; }
|
||||
enum include_once { ZERO41 = 0; }
|
||||
enum instanceof { ZERO42 = 0; }
|
||||
enum insteadof { ZERO43 = 0; }
|
||||
enum interface { ZERO44 = 0; }
|
||||
enum isset { ZERO45 = 0; }
|
||||
enum list { ZERO46 = 0; }
|
||||
enum match { ZERO47 = 0; }
|
||||
enum namespace { ZERO48 = 0; }
|
||||
enum new { ZERO49 = 0; }
|
||||
enum or { ZERO50 = 0; }
|
||||
enum parent { ZERO78 = 0; }
|
||||
enum print { ZERO51 = 0; }
|
||||
enum private { ZERO52 = 0; }
|
||||
enum protected { ZERO53 = 0; }
|
||||
enum public { ZERO54 = 0; }
|
||||
enum readonly { ZERO80 = 0; }
|
||||
enum require { ZERO55 = 0; }
|
||||
enum require_once { ZERO56 = 0; }
|
||||
enum return { ZERO57 = 0; }
|
||||
enum self { ZERO79 = 0; }
|
||||
enum static { ZERO58 = 0; }
|
||||
enum switch { ZERO59 = 0; }
|
||||
enum throw { ZERO60 = 0; }
|
||||
enum trait { ZERO61 = 0; }
|
||||
enum try { ZERO62 = 0; }
|
||||
enum unset { ZERO63 = 0; }
|
||||
enum use { ZERO64 = 0; }
|
||||
enum var { ZERO65 = 0; }
|
||||
enum while { ZERO66 = 0; }
|
||||
enum xor { ZERO67 = 0; }
|
||||
enum yield { ZERO68 = 0; }
|
||||
enum int { ZERO69 = 0; }
|
||||
enum float { ZERO70 = 0; }
|
||||
enum bool { ZERO71 = 0; }
|
||||
enum string { ZERO72 = 0; }
|
||||
enum true { ZERO73 = 0; }
|
||||
enum false { ZERO74 = 0; }
|
||||
enum null { ZERO75 = 0; }
|
||||
enum void { ZERO76 = 0; }
|
||||
enum iterable { ZERO77 = 0; }
|
||||
84
libs/protobuf/php/tests/proto/test_reserved_enum_upper.proto
Normal file
84
libs/protobuf/php/tests/proto/test_reserved_enum_upper.proto
Normal file
@@ -0,0 +1,84 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package upper_enum;
|
||||
|
||||
enum ABSTRACT { ZERO1 = 0; }
|
||||
enum AND { ZERO2 = 0; }
|
||||
enum ARRAY { ZERO3 = 0; }
|
||||
enum AS { ZERO4 = 0; }
|
||||
enum BREAK { ZERO5 = 0; }
|
||||
enum CALLABLE { ZERO6 = 0; }
|
||||
enum CASE { ZERO7 = 0; }
|
||||
enum CATCH { ZERO8 = 0; }
|
||||
enum CLASS { ZERO9 = 0; }
|
||||
enum CLONE { ZERO10 = 0; }
|
||||
enum CONST { ZERO11 = 0; }
|
||||
enum CONTINUE { ZERO12 = 0; }
|
||||
enum DECLARE { ZERO13 = 0; }
|
||||
enum DEFAULT { ZERO14 = 0; }
|
||||
enum DIE { ZERO15 = 0; }
|
||||
enum DO { ZERO16 = 0; }
|
||||
enum ECHO { ZERO17 = 0; }
|
||||
enum ELSE { ZERO18 = 0; }
|
||||
enum ELSEIF { ZERO19 = 0; }
|
||||
enum EMPTY { ZERO20 = 0; }
|
||||
enum ENDDECLARE { ZERO21 = 0; }
|
||||
enum ENDFOR { ZERO22 = 0; }
|
||||
enum ENDFOREACH { ZERO23 = 0; }
|
||||
enum ENDIF { ZERO24 = 0; }
|
||||
enum ENDSWITCH { ZERO25 = 0; }
|
||||
enum ENDWHILE { ZERO26 = 0; }
|
||||
enum EVAL { ZERO27 = 0; }
|
||||
enum EXIT { ZERO28 = 0; }
|
||||
enum EXTENDS { ZERO29 = 0; }
|
||||
enum FINAL { ZERO30 = 0; }
|
||||
enum FINALLY { ZERO31 = 0; }
|
||||
enum FN { ZERO32 = 0; }
|
||||
enum FOR { ZERO33 = 0; }
|
||||
enum FOREACH { ZERO34 = 0; }
|
||||
enum FUNCTION { ZERO35 = 0; }
|
||||
enum GLOBAL { ZERO36 = 0; }
|
||||
enum GOTO { ZERO37 = 0; }
|
||||
enum IF { ZERO38 = 0; }
|
||||
enum IMPLEMENTS { ZERO39 = 0; }
|
||||
enum INCLUDE { ZERO40 = 0; }
|
||||
enum INCLUDE_ONCE { ZERO41 = 0; }
|
||||
enum INSTANCEOF { ZERO42 = 0; }
|
||||
enum INSTEADOF { ZERO43 = 0; }
|
||||
enum INTERFACE { ZERO44 = 0; }
|
||||
enum ISSET { ZERO45 = 0; }
|
||||
enum LIST { ZERO46 = 0; }
|
||||
enum MATCH { ZERO47 = 0; }
|
||||
enum NAMESPACE { ZERO48 = 0; }
|
||||
enum NEW { ZERO49 = 0; }
|
||||
enum OR { ZERO50 = 0; }
|
||||
enum PARENT { ZERO78 = 0; }
|
||||
enum PRINT { ZERO51 = 0; }
|
||||
enum PRIVATE { ZERO52 = 0; }
|
||||
enum PROTECTED { ZERO53 = 0; }
|
||||
enum PUBLIC { ZERO54 = 0; }
|
||||
enum READONLY { ZERO80 = 0; }
|
||||
enum REQUIRE { ZERO55 = 0; }
|
||||
enum REQUIRE_ONCE { ZERO56 = 0; }
|
||||
enum RETURN { ZERO57 = 0; }
|
||||
enum SELF { ZERO79 = 0; }
|
||||
enum STATIC { ZERO58 = 0; }
|
||||
enum SWITCH { ZERO59 = 0; }
|
||||
enum THROW { ZERO60 = 0; }
|
||||
enum TRAIT { ZERO61 = 0; }
|
||||
enum TRY { ZERO62 = 0; }
|
||||
enum UNSET { ZERO63 = 0; }
|
||||
enum USE { ZERO64 = 0; }
|
||||
enum VAR { ZERO65 = 0; }
|
||||
enum WHILE { ZERO66 = 0; }
|
||||
enum XOR { ZERO67 = 0; }
|
||||
enum YIELD { ZERO68 = 0; }
|
||||
enum INT { ZERO69 = 0; }
|
||||
enum FLOAT { ZERO70 = 0; }
|
||||
enum BOOL { ZERO71 = 0; }
|
||||
enum STRING { ZERO72 = 0; }
|
||||
enum TRUE { ZERO73 = 0; }
|
||||
enum FALSE { ZERO74 = 0; }
|
||||
enum NULL { ZERO75 = 0; }
|
||||
enum VOID { ZERO76 = 0; }
|
||||
enum ITERABLE { ZERO77 = 0; }
|
||||
@@ -0,0 +1,86 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package lower_enum_value;
|
||||
|
||||
enum NotAllowed {
|
||||
abstract = 0;
|
||||
and = 1;
|
||||
array = 2;
|
||||
as = 3;
|
||||
break = 4;
|
||||
callable = 5;
|
||||
case = 6;
|
||||
catch = 7;
|
||||
class = 8;
|
||||
clone = 9;
|
||||
const = 10;
|
||||
continue = 11;
|
||||
declare = 12;
|
||||
default = 13;
|
||||
die = 14;
|
||||
do = 15;
|
||||
echo = 16;
|
||||
else = 17;
|
||||
elseif = 18;
|
||||
empty = 19;
|
||||
enddeclare = 20;
|
||||
endfor = 21;
|
||||
endforeach = 22;
|
||||
endif = 23;
|
||||
endswitch = 24;
|
||||
endwhile = 25;
|
||||
eval = 26;
|
||||
exit = 27;
|
||||
extends = 28;
|
||||
final = 29;
|
||||
finally = 30;
|
||||
fn = 31;
|
||||
for = 32;
|
||||
foreach = 33;
|
||||
function = 34;
|
||||
global = 35;
|
||||
goto = 36;
|
||||
if = 37;
|
||||
implements = 38;
|
||||
include = 39;
|
||||
include_once = 40;
|
||||
instanceof = 41;
|
||||
insteadof = 42;
|
||||
interface = 43;
|
||||
isset = 44;
|
||||
list = 45;
|
||||
match = 46;
|
||||
namespace = 47;
|
||||
new = 48;
|
||||
or = 49;
|
||||
parent = 77;
|
||||
print = 50;
|
||||
private = 51;
|
||||
protected = 52;
|
||||
public = 53;
|
||||
readonly = 79;
|
||||
require = 54;
|
||||
require_once = 55;
|
||||
return = 56;
|
||||
self = 78;
|
||||
static = 57;
|
||||
switch = 58;
|
||||
throw = 59;
|
||||
trait = 60;
|
||||
try = 61;
|
||||
unset = 62;
|
||||
use = 63;
|
||||
var = 64;
|
||||
while = 65;
|
||||
xor = 66;
|
||||
yield = 67;
|
||||
int = 68;
|
||||
float = 69;
|
||||
bool = 70;
|
||||
string = 71;
|
||||
true = 72;
|
||||
false = 73;
|
||||
null = 74;
|
||||
void = 75;
|
||||
iterable = 76;
|
||||
}
|
||||
@@ -0,0 +1,86 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package upper_enum_value;
|
||||
|
||||
enum NotAllowed {
|
||||
ABSTRACT = 0;
|
||||
AND = 1;
|
||||
ARRAY = 2;
|
||||
AS = 3;
|
||||
BREAK = 4;
|
||||
CALLABLE = 5;
|
||||
CASE = 6;
|
||||
CATCH = 7;
|
||||
CLASS = 8;
|
||||
CLONE = 9;
|
||||
CONST = 10;
|
||||
CONTINUE = 11;
|
||||
DECLARE = 12;
|
||||
DEFAULT = 13;
|
||||
DIE = 14;
|
||||
DO = 15;
|
||||
ECHO = 16;
|
||||
ELSE = 17;
|
||||
ELSEIF = 18;
|
||||
EMPTY = 19;
|
||||
ENDDECLARE = 20;
|
||||
ENDFOR = 21;
|
||||
ENDFOREACH = 22;
|
||||
ENDIF = 23;
|
||||
ENDSWITCH = 24;
|
||||
ENDWHILE = 25;
|
||||
EVAL = 26;
|
||||
EXIT = 27;
|
||||
EXTENDS = 28;
|
||||
FINAL = 29;
|
||||
FINALLY = 30;
|
||||
FOR = 31;
|
||||
FOREACH = 32;
|
||||
FUNCTION = 33;
|
||||
FN = 34;
|
||||
GLOBAL = 35;
|
||||
GOTO = 36;
|
||||
IF = 37;
|
||||
IMPLEMENTS = 38;
|
||||
INCLUDE = 39;
|
||||
INCLUDE_ONCE = 40;
|
||||
INSTANCEOF = 41;
|
||||
INSTEADOF = 42;
|
||||
INTERFACE = 43;
|
||||
ISSET = 44;
|
||||
LIST = 45;
|
||||
MATCH = 46;
|
||||
NAMESPACE = 47;
|
||||
NEW = 48;
|
||||
OR = 49;
|
||||
PARENT = 77;
|
||||
PRINT = 50;
|
||||
PRIVATE = 51;
|
||||
PROTECTED = 52;
|
||||
PUBLIC = 53;
|
||||
READONLY = 79;
|
||||
REQUIRE = 54;
|
||||
REQUIRE_ONCE = 55;
|
||||
RETURN = 56;
|
||||
SELF = 78;
|
||||
STATIC = 57;
|
||||
SWITCH = 58;
|
||||
THROW = 59;
|
||||
TRAIT = 60;
|
||||
TRY = 61;
|
||||
UNSET = 62;
|
||||
USE = 63;
|
||||
VAR = 64;
|
||||
WHILE = 65;
|
||||
XOR = 66;
|
||||
YIELD = 67;
|
||||
INT = 68;
|
||||
FLOAT = 69;
|
||||
BOOL = 70;
|
||||
STRING = 71;
|
||||
TRUE = 72;
|
||||
FALSE = 73;
|
||||
NULL = 74;
|
||||
VOID = 75;
|
||||
ITERABLE = 76;
|
||||
}
|
||||
@@ -0,0 +1,84 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package lower;
|
||||
|
||||
message abstract {}
|
||||
message and {}
|
||||
message array {}
|
||||
message as {}
|
||||
message break {}
|
||||
message callable {}
|
||||
message case {}
|
||||
message catch {}
|
||||
message class {}
|
||||
message clone {}
|
||||
message const {}
|
||||
message continue {}
|
||||
message declare {}
|
||||
message default {}
|
||||
message die {}
|
||||
message do {}
|
||||
message echo {}
|
||||
message else {}
|
||||
message elseif {}
|
||||
message empty {}
|
||||
message enddeclare {}
|
||||
message endfor {}
|
||||
message endforeach {}
|
||||
message endif {}
|
||||
message endswitch {}
|
||||
message endwhile {}
|
||||
message eval {}
|
||||
message exit {}
|
||||
message extends {}
|
||||
message final {}
|
||||
message finally {}
|
||||
message fn {}
|
||||
message for {}
|
||||
message foreach {}
|
||||
message function {}
|
||||
message global {}
|
||||
message goto {}
|
||||
message if {}
|
||||
message implements {}
|
||||
message include {}
|
||||
message include_once {}
|
||||
message instanceof {}
|
||||
message insteadof {}
|
||||
message interface {}
|
||||
message isset {}
|
||||
message list {}
|
||||
message match {}
|
||||
message namespace {}
|
||||
message new {}
|
||||
message or {}
|
||||
message parent {}
|
||||
message print {}
|
||||
message private {}
|
||||
message protected {}
|
||||
message public {}
|
||||
message readonly {}
|
||||
message require {}
|
||||
message require_once {}
|
||||
message return {}
|
||||
message self {}
|
||||
message static {}
|
||||
message switch {}
|
||||
message throw {}
|
||||
message trait {}
|
||||
message try {}
|
||||
message unset {}
|
||||
message use {}
|
||||
message var {}
|
||||
message while {}
|
||||
message xor {}
|
||||
message yield {}
|
||||
message int {}
|
||||
message float {}
|
||||
message bool {}
|
||||
message string {}
|
||||
message true {}
|
||||
message false {}
|
||||
message null {}
|
||||
message void {}
|
||||
message iterable {}
|
||||
@@ -0,0 +1,84 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package upper;
|
||||
|
||||
message ABSTRACT {}
|
||||
message AND {}
|
||||
message ARRAY {}
|
||||
message AS {}
|
||||
message BREAK {}
|
||||
message CALLABLE {}
|
||||
message CASE {}
|
||||
message CATCH {}
|
||||
message CLASS {}
|
||||
message CLONE {}
|
||||
message CONST {}
|
||||
message CONTINUE {}
|
||||
message DECLARE {}
|
||||
message DEFAULT {}
|
||||
message DIE {}
|
||||
message DO {}
|
||||
message ECHO {}
|
||||
message ELSE {}
|
||||
message ELSEIF {}
|
||||
message EMPTY {}
|
||||
message ENDDECLARE {}
|
||||
message ENDFOR {}
|
||||
message ENDFOREACH {}
|
||||
message ENDIF {}
|
||||
message ENDSWITCH {}
|
||||
message ENDWHILE {}
|
||||
message EVAL {}
|
||||
message EXIT {}
|
||||
message EXTENDS {}
|
||||
message FINAL {}
|
||||
message FINALLY {}
|
||||
message FN {}
|
||||
message FOR {}
|
||||
message FOREACH {}
|
||||
message FUNCTION {}
|
||||
message GLOBAL {}
|
||||
message GOTO {}
|
||||
message IF {}
|
||||
message IMPLEMENTS {}
|
||||
message INCLUDE {}
|
||||
message INCLUDE_ONCE {}
|
||||
message INSTANCEOF {}
|
||||
message INSTEADOF {}
|
||||
message INTERFACE {}
|
||||
message ISSET {}
|
||||
message LIST {}
|
||||
message MATCH {}
|
||||
message NAMESPACE {}
|
||||
message NEW {}
|
||||
message OR {}
|
||||
message PARENT {}
|
||||
message PRINT {}
|
||||
message PRIVATE {}
|
||||
message PROTECTED {}
|
||||
message PUBLIC {}
|
||||
message READONLY {}
|
||||
message REQUIRE {}
|
||||
message REQUIRE_ONCE {}
|
||||
message RETURN {}
|
||||
message SELF {}
|
||||
message STATIC {}
|
||||
message SWITCH {}
|
||||
message THROW {}
|
||||
message TRAIT {}
|
||||
message TRY {}
|
||||
message UNSET {}
|
||||
message USE {}
|
||||
message VAR {}
|
||||
message WHILE {}
|
||||
message XOR {}
|
||||
message YIELD {}
|
||||
message INT {}
|
||||
message FLOAT {}
|
||||
message BOOL {}
|
||||
message STRING {}
|
||||
message TRUE {}
|
||||
message FALSE {}
|
||||
message NULL {}
|
||||
message VOID {}
|
||||
message ITERABLE {}
|
||||
18
libs/protobuf/php/tests/proto/test_service.proto
Normal file
18
libs/protobuf/php/tests/proto/test_service.proto
Normal file
@@ -0,0 +1,18 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package foo;
|
||||
|
||||
option php_generic_services = true;
|
||||
|
||||
service Greeter {
|
||||
rpc SayHello (HelloRequest) returns (HelloReply) {}
|
||||
rpc SayHelloAgain (HelloRequest) returns (HelloReply) {}
|
||||
}
|
||||
|
||||
message HelloRequest {
|
||||
string name = 1;
|
||||
}
|
||||
|
||||
message HelloReply {
|
||||
string message = 1;
|
||||
}
|
||||
13
libs/protobuf/php/tests/proto/test_service_namespace.proto
Normal file
13
libs/protobuf/php/tests/proto/test_service_namespace.proto
Normal file
@@ -0,0 +1,13 @@
|
||||
syntax = "proto3";
|
||||
|
||||
import "proto/test_service.proto";
|
||||
|
||||
package foo;
|
||||
|
||||
option php_generic_services = true;
|
||||
option php_namespace = "Bar";
|
||||
|
||||
service OtherGreeter {
|
||||
rpc SayHello (HelloRequest) returns (HelloReply) {}
|
||||
rpc SayHelloAgain (HelloRequest) returns (HelloReply) {}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
syntax = "proto3";
|
||||
|
||||
import "google/protobuf/wrappers.proto";
|
||||
|
||||
package foo;
|
||||
|
||||
message TestWrapperSetters {
|
||||
google.protobuf.DoubleValue double_value = 1;
|
||||
google.protobuf.FloatValue float_value = 2;
|
||||
google.protobuf.Int64Value int64_value = 3;
|
||||
google.protobuf.UInt64Value uint64_value = 4;
|
||||
google.protobuf.Int32Value int32_value = 5;
|
||||
google.protobuf.UInt32Value uint32_value = 6;
|
||||
google.protobuf.BoolValue bool_value = 7;
|
||||
google.protobuf.StringValue string_value = 8;
|
||||
google.protobuf.BytesValue bytes_value = 9;
|
||||
|
||||
oneof wrapped_oneofs {
|
||||
google.protobuf.DoubleValue double_value_oneof = 10;
|
||||
google.protobuf.StringValue string_value_oneof = 11;
|
||||
}
|
||||
|
||||
repeated google.protobuf.StringValue repeated_string_value = 12;
|
||||
|
||||
map<string, google.protobuf.StringValue> map_string_value = 13;
|
||||
}
|
||||
Reference in New Issue
Block a user