-
Notifications
You must be signed in to change notification settings - Fork 129
fix: don't change PHP functions which are reserved words #3317
Conversation
Codecov Report
@@ Coverage Diff @@
## master #3317 +/- ##
=========================================
Coverage 87.14% 87.14%
- Complexity 6120 6121 +1
=========================================
Files 495 495
Lines 24172 24172
Branches 2637 2637
=========================================
+ Hits 21064 21065 +1
Misses 2242 2242
+ Partials 866 865 -1
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can it result in a breaking change for the existing PHP gapic clients which already have the function names changed even though it was not necessary.
@bshaffer LGTM with a question |
@vam-google I searched for the function prefix |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm, but I'm no PHP expert
@jdpedrie caught that this is only the case for PHP 7.0+ Versions of PHP 5.6 and below will throw fatal errors for functions named with reserved words |
Note: Removing the escaping of functions for PHP Reserved Words for all GAPICs exposes the very low-likelyhood that we might generating a GAPIC with a PHP Fatal Error on PHP < 7 between now and when we deprecate support for PHP < 7. The plan is to deprecate support in early 2021. If such a fatal error occurs, we will be able to wrap the functions in reserved words for all but DIREGAPIC client libraries, which will all require PHP > 7 from the start. |
…)" This reverts commit 3ff8ca9.
with the exception of
__halt_compiler
, which is so unlikely to be generated as a function name that we don't need to write a case for it, none of the PHP keywords are invalid as class function names. We can safely remove wrapping them.