From e259b515a5baae2d7d7623af62ea87079a5e91a0 Mon Sep 17 00:00:00 2001 From: Bo Yang Date: Tue, 10 Jan 2017 01:02:35 +0000 Subject: Fix generated code when there is no namespace but there is enum definition. --- php/tests/generated_class_test.php | 11 ++++++++--- php/tests/proto/test_no_namespace.proto | 7 ++++++- src/google/protobuf/compiler/php/php_generator.cc | 7 +++++-- 3 files changed, 19 insertions(+), 6 deletions(-) diff --git a/php/tests/generated_class_test.php b/php/tests/generated_class_test.php index 27912ecd..6381419d 100644 --- a/php/tests/generated_class_test.php +++ b/php/tests/generated_class_test.php @@ -1,6 +1,7 @@ package().empty()) { printer.Print( "namespace ^name^;\n\n", "name", fullname.substr(0, lastindex)); + } + GenerateEnumDocComment(&printer, en); + + if (lastindex != string::npos) { printer.Print( "class ^name^\n" "{\n", -- cgit v1.2.3