Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
P
protobuf
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
protobuf
Commits
fba2acd7
Commit
fba2acd7
authored
Apr 24, 2017
by
Paul Yang
Committed by
GitHub
Apr 24, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add nested enum descriptor in php rumtime. (#3009)
parent
e64b618b
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
1 deletion
+11
-1
DescriptorPool.php
php/src/Google/Protobuf/Internal/DescriptorPool.php
+3
-0
descriptor.php
php/src/Google/Protobuf/descriptor.php
+6
-0
generated_class_test.php
php/tests/generated_class_test.php
+2
-1
No files found.
php/src/Google/Protobuf/Internal/DescriptorPool.php
View file @
fba2acd7
...
...
@@ -95,6 +95,9 @@ class DescriptorPool
foreach
(
$descriptor
->
getNestedType
()
as
$nested_type
)
{
$this
->
addDescriptor
(
$nested_type
);
}
foreach
(
$descriptor
->
getEnumType
()
as
$enum_type
)
{
$this
->
addEnumDescriptor
(
$enum_type
);
}
}
public
function
addEnumDescriptor
(
$descriptor
)
...
...
php/src/Google/Protobuf/descriptor.php
View file @
fba2acd7
...
...
@@ -210,6 +210,12 @@ class Descriptor
$nested_proto
,
$file_proto
,
$message_name_without_package
));
}
// Handle nested enum.
foreach
(
$proto
->
getEnumType
()
as
$enum_proto
)
{
$desc
->
addEnumType
(
EnumDescriptor
::
buildFromProto
(
$enum_proto
,
$file_proto
,
$message_name_without_package
));
}
// Handle oneof fields.
foreach
(
$proto
->
getOneofDecl
()
as
$oneof_proto
)
{
$desc
->
addOneofDecl
(
...
...
php/tests/generated_class_test.php
View file @
fba2acd7
...
...
@@ -839,7 +839,8 @@ class GeneratedClassTest extends TestBase
public
function
testMessageWithoutNamespace
()
{
$m
=
new
TestMessage
();
$m
->
setOptionalNoNamespaceMessage
(
new
NoNameSpaceMessage
());
$sub
=
new
NoNameSpaceMessage
();
$m
->
setOptionalNoNamespaceMessage
(
$sub
);
$m
->
getRepeatedNoNamespaceMessage
()[]
=
new
NoNameSpaceMessage
();
$n
=
new
NoNamespaceMessage
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment