Skip to content

Commit

Permalink
Make php message class final to avoid mocking (#6277)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
TeBoring committed Jun 19, 2019
1 parent 98f0447 commit 7f84a94
Show file tree
Hide file tree
Showing 29 changed files with 28 additions and 28 deletions.
Binary file modified csharp/src/Google.Protobuf.Test/testprotos.pb
Binary file not shown.
2 changes: 1 addition & 1 deletion php/src/Google/Protobuf/Internal/DescriptorProto.php

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion php/src/Google/Protobuf/Internal/EnumDescriptorProto.php

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion php/src/Google/Protobuf/Internal/EnumOptions.php

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion php/src/Google/Protobuf/Internal/EnumValueOptions.php

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion php/src/Google/Protobuf/Internal/ExtensionRangeOptions.php

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion php/src/Google/Protobuf/Internal/FieldDescriptorProto.php

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion php/src/Google/Protobuf/Internal/FieldOptions.php

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion php/src/Google/Protobuf/Internal/FileDescriptorProto.php

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion php/src/Google/Protobuf/Internal/FileDescriptorSet.php

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion php/src/Google/Protobuf/Internal/FileOptions.php

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion php/src/Google/Protobuf/Internal/GeneratedCodeInfo.php

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion php/src/Google/Protobuf/Internal/MessageOptions.php

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion php/src/Google/Protobuf/Internal/MethodDescriptorProto.php

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion php/src/Google/Protobuf/Internal/MethodOptions.php

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion php/src/Google/Protobuf/Internal/OneofDescriptorProto.php

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion php/src/Google/Protobuf/Internal/OneofOptions.php

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion php/src/Google/Protobuf/Internal/ServiceOptions.php

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion php/src/Google/Protobuf/Internal/SourceCodeInfo.php

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion php/src/Google/Protobuf/Internal/UninterpretedOption.php

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/google/protobuf/compiler/php/php_generator.cc
Expand Up @@ -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);
Expand Down

0 comments on commit 7f84a94

Please sign in to comment.