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
54288a01
Unverified
Commit
54288a01
authored
Jun 21, 2019
by
Paul Yang
Committed by
GitHub
Jun 21, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename get/setXXXValue to get/setXXXUnwrapped (#6295)
parent
b7a5772c
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
3 deletions
+3
-3
wrapper_type_setters_test.php
php/tests/wrapper_type_setters_test.php
+0
-0
php_generator.cc
src/google/protobuf/compiler/php/php_generator.cc
+3
-3
No files found.
php/tests/wrapper_type_setters_test.php
View file @
54288a01
This diff is collapsed.
Click to expand it.
src/google/protobuf/compiler/php/php_generator.cc
View file @
54288a01
...
...
@@ -678,14 +678,14 @@ void GenerateFieldAccessor(const FieldDescriptor* field, bool is_descriptor,
field
->
name
());
}
// For wrapper types, generate an additional getXXX
Value
getter
// For wrapper types, generate an additional getXXX
Unwrapped
getter
if
(
!
field
->
is_map
()
&&
!
field
->
is_repeated
()
&&
field
->
cpp_type
()
==
FieldDescriptor
::
CPPTYPE_MESSAGE
&&
IsWrapperType
(
field
))
{
GenerateWrapperFieldGetterDocComment
(
printer
,
field
);
printer
->
Print
(
"public function get^camel_name^
Value
()
\n
"
"public function get^camel_name^
Unwrapped
()
\n
"
"{
\n
"
" $wrapper = $this->get^camel_name^();
\n
"
" return is_null($wrapper) ? null : $wrapper->getValue();
\n
"
...
...
@@ -798,7 +798,7 @@ void GenerateFieldAccessor(const FieldDescriptor* field, bool is_descriptor,
IsWrapperType
(
field
))
{
GenerateWrapperFieldSetterDocComment
(
printer
,
field
);
printer
->
Print
(
"public function set^camel_name^
Value
($var)
\n
"
"public function set^camel_name^
Unwrapped
($var)
\n
"
"{
\n
"
" $wrappedVar = is_null($var) ? null : new
\\
^wrapper_type^(['value' => $var]);
\n
"
" return $this->set^camel_name^($wrappedVar);
\n
"
...
...
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