From 7f84a943667358a53bd5d255ee9769ca83e75cd9 Mon Sep 17 00:00:00 2001 From: Paul Yang Date: Tue, 18 Jun 2019 17:12:55 -0700 Subject: [PATCH] Make php message class final to avoid mocking (#6277) * Make php message class final Because proto messages are just data object, they should not be mocked. Explicitly make them final to avoid accidental usage. * Update generated descriptors --- csharp/src/Google.Protobuf.Test/testprotos.pb | Bin 205207 -> 205207 bytes .../Protobuf/Internal/DescriptorProto.php | 2 +- .../DescriptorProto/ExtensionRange.php | 2 +- .../DescriptorProto/ReservedRange.php | 2 +- .../Protobuf/Internal/EnumDescriptorProto.php | 2 +- .../EnumDescriptorProto/EnumReservedRange.php | 2 +- .../Google/Protobuf/Internal/EnumOptions.php | 2 +- .../Internal/EnumValueDescriptorProto.php | 2 +- .../Protobuf/Internal/EnumValueOptions.php | 2 +- .../Internal/ExtensionRangeOptions.php | 2 +- .../Internal/FieldDescriptorProto.php | 2 +- .../Google/Protobuf/Internal/FieldOptions.php | 2 +- .../Protobuf/Internal/FileDescriptorProto.php | 2 +- .../Protobuf/Internal/FileDescriptorSet.php | 2 +- .../Google/Protobuf/Internal/FileOptions.php | 2 +- .../Protobuf/Internal/GeneratedCodeInfo.php | 2 +- .../Internal/GeneratedCodeInfo/Annotation.php | 2 +- .../Protobuf/Internal/MessageOptions.php | 2 +- .../Internal/MethodDescriptorProto.php | 2 +- .../Protobuf/Internal/MethodOptions.php | 2 +- .../Internal/OneofDescriptorProto.php | 2 +- .../Google/Protobuf/Internal/OneofOptions.php | 2 +- .../Internal/ServiceDescriptorProto.php | 2 +- .../Protobuf/Internal/ServiceOptions.php | 2 +- .../Protobuf/Internal/SourceCodeInfo.php | 2 +- .../Internal/SourceCodeInfo/Location.php | 2 +- .../Protobuf/Internal/UninterpretedOption.php | 2 +- .../Internal/UninterpretedOption/NamePart.php | 2 +- .../protobuf/compiler/php/php_generator.cc | 2 +- 29 files changed, 28 insertions(+), 28 deletions(-) diff --git a/csharp/src/Google.Protobuf.Test/testprotos.pb b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A~DeG z(^YRPVfl9t2uuS3(@F`dfgmgO$P(@Xos@cHiK=R6j6vPSc;txC6>n7oyAmIzq5j(h zLKKrUS~KO1thI1ktJGP-3Qe?1tqDM6*(#I%a~=>`w#tf>ni0ixKMqK1RQkV)fZ=^W z;+C`&;FZUHRc?W_9I;xdipplDL~kkliAN+OL9 z$z)ZoMw0cAgvx2mkO%OvPH; z+0~-!vT&aBD~K*hdbr_b-eAApcEe~6MriJa49`;f1w^nLa(2oOTNpoLF z>z>veFucEzPSSaop=ZDpW88apH#?LbH$^EkiW)Z>PzLNAHyTg|L>f05PzGpV+-Sfz z;K;{G125=c;J77uRmsz-&9657eDBU3J5}LLsU16i>iu~STfGs>erJh*gm}wzRv8pQ zvO;xM8IZ&+S-H^prH+7zlU~_g_U5L^d?pgpWPUj$rb$^mH^)TcnUomdS50SNnD)l@ lvTLiR^QlNf)A>}Sp=nt>J4Z!7Y^M+2-p4Yx_gSY-{vX!_kkSAE diff --git a/php/src/Google/Protobuf/Internal/DescriptorProto.php b/php/src/Google/Protobuf/Internal/DescriptorProto.php index 3b215d52ae4d..2d52831451ce 100644 --- a/php/src/Google/Protobuf/Internal/DescriptorProto.php +++ b/php/src/Google/Protobuf/Internal/DescriptorProto.php @@ -15,7 +15,7 @@ * * Generated from protobuf message google.protobuf.DescriptorProto */ -class DescriptorProto extends \Google\Protobuf\Internal\Message +final class DescriptorProto extends \Google\Protobuf\Internal\Message { /** * Generated from protobuf field optional string name = 1; diff --git a/php/src/Google/Protobuf/Internal/DescriptorProto/ExtensionRange.php b/php/src/Google/Protobuf/Internal/DescriptorProto/ExtensionRange.php index a2057fd5d17e..fb98f7d5a090 100644 --- a/php/src/Google/Protobuf/Internal/DescriptorProto/ExtensionRange.php +++ b/php/src/Google/Protobuf/Internal/DescriptorProto/ExtensionRange.php @@ -13,7 +13,7 @@ /** * Generated from protobuf message google.protobuf.DescriptorProto.ExtensionRange */ -class ExtensionRange extends \Google\Protobuf\Internal\Message +final class ExtensionRange extends \Google\Protobuf\Internal\Message { /** * Inclusive. diff --git a/php/src/Google/Protobuf/Internal/DescriptorProto/ReservedRange.php b/php/src/Google/Protobuf/Internal/DescriptorProto/ReservedRange.php index 73c964faa0b5..fa46419a53ae 100644 --- a/php/src/Google/Protobuf/Internal/DescriptorProto/ReservedRange.php +++ b/php/src/Google/Protobuf/Internal/DescriptorProto/ReservedRange.php @@ -17,7 +17,7 @@ * * Generated from protobuf message google.protobuf.DescriptorProto.ReservedRange */ -class ReservedRange extends \Google\Protobuf\Internal\Message +final class ReservedRange extends \Google\Protobuf\Internal\Message { /** * Inclusive. diff --git a/php/src/Google/Protobuf/Internal/EnumDescriptorProto.php b/php/src/Google/Protobuf/Internal/EnumDescriptorProto.php index da30fa99067f..b7c3a208bec2 100644 --- a/php/src/Google/Protobuf/Internal/EnumDescriptorProto.php +++ b/php/src/Google/Protobuf/Internal/EnumDescriptorProto.php @@ -15,7 +15,7 @@ * * Generated from protobuf message google.protobuf.EnumDescriptorProto */ -class EnumDescriptorProto extends \Google\Protobuf\Internal\Message +final class EnumDescriptorProto extends \Google\Protobuf\Internal\Message { /** * Generated from protobuf field optional string name = 1; diff --git a/php/src/Google/Protobuf/Internal/EnumDescriptorProto/EnumReservedRange.php b/php/src/Google/Protobuf/Internal/EnumDescriptorProto/EnumReservedRange.php index e1079585ec01..0103a1b30178 100644 --- a/php/src/Google/Protobuf/Internal/EnumDescriptorProto/EnumReservedRange.php +++ b/php/src/Google/Protobuf/Internal/EnumDescriptorProto/EnumReservedRange.php @@ -19,7 +19,7 @@ * * Generated from protobuf message google.protobuf.EnumDescriptorProto.EnumReservedRange */ -class EnumReservedRange extends \Google\Protobuf\Internal\Message +final class EnumReservedRange extends \Google\Protobuf\Internal\Message { /** * Inclusive. diff --git a/php/src/Google/Protobuf/Internal/EnumOptions.php b/php/src/Google/Protobuf/Internal/EnumOptions.php index 3d74c81c2176..4c73d527409d 100644 --- a/php/src/Google/Protobuf/Internal/EnumOptions.php +++ b/php/src/Google/Protobuf/Internal/EnumOptions.php @@ -13,7 +13,7 @@ /** * Generated from protobuf message google.protobuf.EnumOptions */ -class EnumOptions extends \Google\Protobuf\Internal\Message +final class EnumOptions extends \Google\Protobuf\Internal\Message { /** * Set this option to true to allow mapping different tag names to the same diff --git a/php/src/Google/Protobuf/Internal/EnumValueDescriptorProto.php b/php/src/Google/Protobuf/Internal/EnumValueDescriptorProto.php index 50bda008e899..d5a0a9afb532 100644 --- a/php/src/Google/Protobuf/Internal/EnumValueDescriptorProto.php +++ b/php/src/Google/Protobuf/Internal/EnumValueDescriptorProto.php @@ -15,7 +15,7 @@ * * Generated from protobuf message google.protobuf.EnumValueDescriptorProto */ -class EnumValueDescriptorProto extends \Google\Protobuf\Internal\Message +final class EnumValueDescriptorProto extends \Google\Protobuf\Internal\Message { /** * Generated from protobuf field optional string name = 1; diff --git a/php/src/Google/Protobuf/Internal/EnumValueOptions.php b/php/src/Google/Protobuf/Internal/EnumValueOptions.php index a267c6d5e25e..50ac904ff972 100644 --- a/php/src/Google/Protobuf/Internal/EnumValueOptions.php +++ b/php/src/Google/Protobuf/Internal/EnumValueOptions.php @@ -13,7 +13,7 @@ /** * Generated from protobuf message google.protobuf.EnumValueOptions */ -class EnumValueOptions extends \Google\Protobuf\Internal\Message +final class EnumValueOptions extends \Google\Protobuf\Internal\Message { /** * Is this enum value deprecated? diff --git a/php/src/Google/Protobuf/Internal/ExtensionRangeOptions.php b/php/src/Google/Protobuf/Internal/ExtensionRangeOptions.php index 00fbebecaf6a..97ad2c055f85 100644 --- a/php/src/Google/Protobuf/Internal/ExtensionRangeOptions.php +++ b/php/src/Google/Protobuf/Internal/ExtensionRangeOptions.php @@ -13,7 +13,7 @@ /** * Generated from protobuf message google.protobuf.ExtensionRangeOptions */ -class ExtensionRangeOptions extends \Google\Protobuf\Internal\Message +final class ExtensionRangeOptions extends \Google\Protobuf\Internal\Message { /** * The parser stores options it doesn't recognize here. See above. diff --git a/php/src/Google/Protobuf/Internal/FieldDescriptorProto.php b/php/src/Google/Protobuf/Internal/FieldDescriptorProto.php index e578197515f8..6f8643c8d72c 100644 --- a/php/src/Google/Protobuf/Internal/FieldDescriptorProto.php +++ b/php/src/Google/Protobuf/Internal/FieldDescriptorProto.php @@ -15,7 +15,7 @@ * * Generated from protobuf message google.protobuf.FieldDescriptorProto */ -class FieldDescriptorProto extends \Google\Protobuf\Internal\Message +final class FieldDescriptorProto extends \Google\Protobuf\Internal\Message { /** * Generated from protobuf field optional string name = 1; diff --git a/php/src/Google/Protobuf/Internal/FieldOptions.php b/php/src/Google/Protobuf/Internal/FieldOptions.php index 751c278d7823..47d1951d1659 100644 --- a/php/src/Google/Protobuf/Internal/FieldOptions.php +++ b/php/src/Google/Protobuf/Internal/FieldOptions.php @@ -13,7 +13,7 @@ /** * Generated from protobuf message google.protobuf.FieldOptions */ -class FieldOptions extends \Google\Protobuf\Internal\Message +final class FieldOptions extends \Google\Protobuf\Internal\Message { /** * The ctype option instructs the C++ code generator to use a different diff --git a/php/src/Google/Protobuf/Internal/FileDescriptorProto.php b/php/src/Google/Protobuf/Internal/FileDescriptorProto.php index cb10aa79390f..e95205476cf8 100644 --- a/php/src/Google/Protobuf/Internal/FileDescriptorProto.php +++ b/php/src/Google/Protobuf/Internal/FileDescriptorProto.php @@ -15,7 +15,7 @@ * * Generated from protobuf message google.protobuf.FileDescriptorProto */ -class FileDescriptorProto extends \Google\Protobuf\Internal\Message +final class FileDescriptorProto extends \Google\Protobuf\Internal\Message { /** * file name, relative to root of source tree diff --git a/php/src/Google/Protobuf/Internal/FileDescriptorSet.php b/php/src/Google/Protobuf/Internal/FileDescriptorSet.php index 9907b17d73c5..c9a38808fb4c 100644 --- a/php/src/Google/Protobuf/Internal/FileDescriptorSet.php +++ b/php/src/Google/Protobuf/Internal/FileDescriptorSet.php @@ -16,7 +16,7 @@ * * Generated from protobuf message google.protobuf.FileDescriptorSet */ -class FileDescriptorSet extends \Google\Protobuf\Internal\Message +final class FileDescriptorSet extends \Google\Protobuf\Internal\Message { /** * Generated from protobuf field repeated .google.protobuf.FileDescriptorProto file = 1; diff --git a/php/src/Google/Protobuf/Internal/FileOptions.php b/php/src/Google/Protobuf/Internal/FileOptions.php index 6fea195ec18a..911000501643 100644 --- a/php/src/Google/Protobuf/Internal/FileOptions.php +++ b/php/src/Google/Protobuf/Internal/FileOptions.php @@ -13,7 +13,7 @@ /** * Generated from protobuf message google.protobuf.FileOptions */ -class FileOptions extends \Google\Protobuf\Internal\Message +final class FileOptions extends \Google\Protobuf\Internal\Message { /** * Sets the Java package where classes generated from this .proto will be diff --git a/php/src/Google/Protobuf/Internal/GeneratedCodeInfo.php b/php/src/Google/Protobuf/Internal/GeneratedCodeInfo.php index f5a65bea4610..c99d77afa3ad 100644 --- a/php/src/Google/Protobuf/Internal/GeneratedCodeInfo.php +++ b/php/src/Google/Protobuf/Internal/GeneratedCodeInfo.php @@ -17,7 +17,7 @@ * * Generated from protobuf message google.protobuf.GeneratedCodeInfo */ -class GeneratedCodeInfo extends \Google\Protobuf\Internal\Message +final class GeneratedCodeInfo extends \Google\Protobuf\Internal\Message { /** * An Annotation connects some span of text in generated code to an element diff --git a/php/src/Google/Protobuf/Internal/GeneratedCodeInfo/Annotation.php b/php/src/Google/Protobuf/Internal/GeneratedCodeInfo/Annotation.php index 09f958d2512c..8cc3cdf4573f 100644 --- a/php/src/Google/Protobuf/Internal/GeneratedCodeInfo/Annotation.php +++ b/php/src/Google/Protobuf/Internal/GeneratedCodeInfo/Annotation.php @@ -13,7 +13,7 @@ /** * Generated from protobuf message google.protobuf.GeneratedCodeInfo.Annotation */ -class Annotation extends \Google\Protobuf\Internal\Message +final class Annotation extends \Google\Protobuf\Internal\Message { /** * Identifies the element in the original source .proto file. This field diff --git a/php/src/Google/Protobuf/Internal/MessageOptions.php b/php/src/Google/Protobuf/Internal/MessageOptions.php index 445394211028..9032c97e9b10 100644 --- a/php/src/Google/Protobuf/Internal/MessageOptions.php +++ b/php/src/Google/Protobuf/Internal/MessageOptions.php @@ -13,7 +13,7 @@ /** * Generated from protobuf message google.protobuf.MessageOptions */ -class MessageOptions extends \Google\Protobuf\Internal\Message +final class MessageOptions extends \Google\Protobuf\Internal\Message { /** * Set true to use the old proto1 MessageSet wire format for extensions. diff --git a/php/src/Google/Protobuf/Internal/MethodDescriptorProto.php b/php/src/Google/Protobuf/Internal/MethodDescriptorProto.php index 1bd5dd3e1c43..25a2c166fd65 100644 --- a/php/src/Google/Protobuf/Internal/MethodDescriptorProto.php +++ b/php/src/Google/Protobuf/Internal/MethodDescriptorProto.php @@ -15,7 +15,7 @@ * * Generated from protobuf message google.protobuf.MethodDescriptorProto */ -class MethodDescriptorProto extends \Google\Protobuf\Internal\Message +final class MethodDescriptorProto extends \Google\Protobuf\Internal\Message { /** * Generated from protobuf field optional string name = 1; diff --git a/php/src/Google/Protobuf/Internal/MethodOptions.php b/php/src/Google/Protobuf/Internal/MethodOptions.php index a2c729a9bbed..a9c093ad5d76 100644 --- a/php/src/Google/Protobuf/Internal/MethodOptions.php +++ b/php/src/Google/Protobuf/Internal/MethodOptions.php @@ -13,7 +13,7 @@ /** * Generated from protobuf message google.protobuf.MethodOptions */ -class MethodOptions extends \Google\Protobuf\Internal\Message +final class MethodOptions extends \Google\Protobuf\Internal\Message { /** * Is this method deprecated? diff --git a/php/src/Google/Protobuf/Internal/OneofDescriptorProto.php b/php/src/Google/Protobuf/Internal/OneofDescriptorProto.php index 9ecfe5cbfe96..a703fcb702ca 100644 --- a/php/src/Google/Protobuf/Internal/OneofDescriptorProto.php +++ b/php/src/Google/Protobuf/Internal/OneofDescriptorProto.php @@ -15,7 +15,7 @@ * * Generated from protobuf message google.protobuf.OneofDescriptorProto */ -class OneofDescriptorProto extends \Google\Protobuf\Internal\Message +final class OneofDescriptorProto extends \Google\Protobuf\Internal\Message { /** * Generated from protobuf field optional string name = 1; diff --git a/php/src/Google/Protobuf/Internal/OneofOptions.php b/php/src/Google/Protobuf/Internal/OneofOptions.php index 46b516f3019f..749051f31fe8 100644 --- a/php/src/Google/Protobuf/Internal/OneofOptions.php +++ b/php/src/Google/Protobuf/Internal/OneofOptions.php @@ -13,7 +13,7 @@ /** * Generated from protobuf message google.protobuf.OneofOptions */ -class OneofOptions extends \Google\Protobuf\Internal\Message +final class OneofOptions extends \Google\Protobuf\Internal\Message { /** * The parser stores options it doesn't recognize here. See above. diff --git a/php/src/Google/Protobuf/Internal/ServiceDescriptorProto.php b/php/src/Google/Protobuf/Internal/ServiceDescriptorProto.php index 8de7afd0bcd9..9534f0480e76 100644 --- a/php/src/Google/Protobuf/Internal/ServiceDescriptorProto.php +++ b/php/src/Google/Protobuf/Internal/ServiceDescriptorProto.php @@ -15,7 +15,7 @@ * * Generated from protobuf message google.protobuf.ServiceDescriptorProto */ -class ServiceDescriptorProto extends \Google\Protobuf\Internal\Message +final class ServiceDescriptorProto extends \Google\Protobuf\Internal\Message { /** * Generated from protobuf field optional string name = 1; diff --git a/php/src/Google/Protobuf/Internal/ServiceOptions.php b/php/src/Google/Protobuf/Internal/ServiceOptions.php index 67162f3764e6..55bf7a77582a 100644 --- a/php/src/Google/Protobuf/Internal/ServiceOptions.php +++ b/php/src/Google/Protobuf/Internal/ServiceOptions.php @@ -13,7 +13,7 @@ /** * Generated from protobuf message google.protobuf.ServiceOptions */ -class ServiceOptions extends \Google\Protobuf\Internal\Message +final class ServiceOptions extends \Google\Protobuf\Internal\Message { /** * Is this service deprecated? diff --git a/php/src/Google/Protobuf/Internal/SourceCodeInfo.php b/php/src/Google/Protobuf/Internal/SourceCodeInfo.php index dfeb69ff6978..3ddd89226202 100644 --- a/php/src/Google/Protobuf/Internal/SourceCodeInfo.php +++ b/php/src/Google/Protobuf/Internal/SourceCodeInfo.php @@ -16,7 +16,7 @@ * * Generated from protobuf message google.protobuf.SourceCodeInfo */ -class SourceCodeInfo extends \Google\Protobuf\Internal\Message +final class SourceCodeInfo extends \Google\Protobuf\Internal\Message { /** * A Location identifies a piece of source code in a .proto file which diff --git a/php/src/Google/Protobuf/Internal/SourceCodeInfo/Location.php b/php/src/Google/Protobuf/Internal/SourceCodeInfo/Location.php index bad247a11f66..470d64c6e23d 100644 --- a/php/src/Google/Protobuf/Internal/SourceCodeInfo/Location.php +++ b/php/src/Google/Protobuf/Internal/SourceCodeInfo/Location.php @@ -13,7 +13,7 @@ /** * Generated from protobuf message google.protobuf.SourceCodeInfo.Location */ -class Location extends \Google\Protobuf\Internal\Message +final class Location extends \Google\Protobuf\Internal\Message { /** * Identifies which part of the FileDescriptorProto was defined at this diff --git a/php/src/Google/Protobuf/Internal/UninterpretedOption.php b/php/src/Google/Protobuf/Internal/UninterpretedOption.php index 3b517ec552c1..39273d62fa7a 100644 --- a/php/src/Google/Protobuf/Internal/UninterpretedOption.php +++ b/php/src/Google/Protobuf/Internal/UninterpretedOption.php @@ -20,7 +20,7 @@ * * Generated from protobuf message google.protobuf.UninterpretedOption */ -class UninterpretedOption extends \Google\Protobuf\Internal\Message +final class UninterpretedOption extends \Google\Protobuf\Internal\Message { /** * Generated from protobuf field repeated .google.protobuf.UninterpretedOption.NamePart name = 2; diff --git a/php/src/Google/Protobuf/Internal/UninterpretedOption/NamePart.php b/php/src/Google/Protobuf/Internal/UninterpretedOption/NamePart.php index 92ee4b44b92f..a2f9250f936f 100644 --- a/php/src/Google/Protobuf/Internal/UninterpretedOption/NamePart.php +++ b/php/src/Google/Protobuf/Internal/UninterpretedOption/NamePart.php @@ -19,7 +19,7 @@ * * Generated from protobuf message google.protobuf.UninterpretedOption.NamePart */ -class NamePart extends \Google\Protobuf\Internal\Message +final class NamePart extends \Google\Protobuf\Internal\Message { /** * Generated from protobuf field required string name_part = 1; diff --git a/src/google/protobuf/compiler/php/php_generator.cc b/src/google/protobuf/compiler/php/php_generator.cc index c47ea33f798b..60d7d8b73b7d 100644 --- a/src/google/protobuf/compiler/php/php_generator.cc +++ b/src/google/protobuf/compiler/php/php_generator.cc @@ -1307,7 +1307,7 @@ void GenerateMessageFile(const FileDescriptor* file, const Descriptor* message, } printer.Print( - "class ^name^ extends \\Google\\Protobuf\\Internal\\Message\n" + "final class ^name^ extends \\Google\\Protobuf\\Internal\\Message\n" "{\n", "name", fullname); Indent(&printer);