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
d32f5b4d
Commit
d32f5b4d
authored
Aug 01, 2017
by
Brent Shaffer
Committed by
Paul Yang
Aug 01, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Removes unnecessary pass-by-references in PHP internal classes (#3433)
parent
07243145
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
10 deletions
+10
-10
DescriptorPool.php
php/src/Google/Protobuf/Internal/DescriptorPool.php
+7
-7
MapEntry.php
php/src/Google/Protobuf/Internal/MapEntry.php
+2
-2
OneofDescriptor.php
php/src/Google/Protobuf/Internal/OneofDescriptor.php
+1
-1
No files found.
php/src/Google/Protobuf/Internal/DescriptorPool.php
View file @
d32f5b4d
...
...
@@ -61,17 +61,17 @@ class DescriptorPool
$files
->
mergeFromString
(
$data
);
$file
=
FileDescriptor
::
buildFromProto
(
$files
->
getFile
()[
0
]);
foreach
(
$file
->
getMessageType
()
as
&
$desc
)
{
foreach
(
$file
->
getMessageType
()
as
$desc
)
{
$this
->
addDescriptor
(
$desc
);
}
unset
(
$desc
);
foreach
(
$file
->
getEnumType
()
as
&
$desc
)
{
foreach
(
$file
->
getEnumType
()
as
$desc
)
{
$this
->
addEnumDescriptor
(
$desc
);
}
unset
(
$desc
);
foreach
(
$file
->
getMessageType
()
as
&
$desc
)
{
foreach
(
$file
->
getMessageType
()
as
$desc
)
{
$this
->
crossLink
(
$desc
);
}
unset
(
$desc
);
...
...
@@ -129,9 +129,9 @@ class DescriptorPool
return
$this
->
class_to_enum_desc
[
$klass
];
}
private
function
crossLink
(
&
$desc
)
private
function
crossLink
(
Descriptor
$desc
)
{
foreach
(
$desc
->
getField
()
as
&
$field
)
{
foreach
(
$desc
->
getField
()
as
$field
)
{
switch
(
$field
->
getType
())
{
case
GPBType
::
MESSAGE
:
$proto
=
$field
->
getMessageType
();
...
...
@@ -149,7 +149,7 @@ class DescriptorPool
}
unset
(
$field
);
foreach
(
$desc
->
getNestedType
()
as
&
$nested_type
)
{
foreach
(
$desc
->
getNestedType
()
as
$nested_type
)
{
$this
->
crossLink
(
$nested_type
);
}
unset
(
$nested_type
);
...
...
@@ -157,7 +157,7 @@ class DescriptorPool
public
function
finish
()
{
foreach
(
$this
->
class_to_desc
as
$klass
=>
&
$desc
)
{
foreach
(
$this
->
class_to_desc
as
$klass
=>
$desc
)
{
$this
->
crossLink
(
$desc
);
}
unset
(
$desc
);
...
...
php/src/Google/Protobuf/Internal/MapEntry.php
View file @
d32f5b4d
...
...
@@ -39,7 +39,7 @@ class MapEntry extends Message
public
$key
;
public
$value
;
public
function
setKey
(
&
$key
)
{
public
function
setKey
(
$key
)
{
$this
->
key
=
$key
;
}
...
...
@@ -47,7 +47,7 @@ class MapEntry extends Message
return
$this
->
key
;
}
public
function
setValue
(
&
$value
)
{
public
function
setValue
(
$value
)
{
$this
->
value
=
$value
;
}
...
...
php/src/Google/Protobuf/Internal/OneofDescriptor.php
View file @
d32f5b4d
...
...
@@ -48,7 +48,7 @@ class OneofDescriptor
return
$this
->
name
;
}
public
function
addField
(
&
$field
)
public
function
addField
(
Descriptor
$field
)
{
$this
->
fields
[]
=
$field
;
}
...
...
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