This was initially discussed in the Inteliphense project in this issue.
The tool is detecting an instance of a function using the name match
in the CMS core code. This is a PHP keyword since version 8.0 according to the manual
Change the name of this functions both at definition:
And the calling location (there seems to be only one place):
Some candidates for the new name:
I am not fully aware of all applicable coding rules (naming conventions), so I prefer to have someone with more expertise address the final code and include in the project if relevant. Does this need to be changed and what is the preferred final code for it?
Labels |
Added:
No Code Attached Yet
|
@wilsonge, thanks for the reference to the RFC. It indeed works on the web server, most definitely, otherwise the webapp would have been broken during testing. I will contact the guys at Intelephense again so that they tweak the code sensing and allow this particular one in the stated contexts.
Given that fact, I understand there is no need for code changes, but maybe it should follow the path of deprecation so that extension developers have time to move away from it and eventually it can be taken out altogether and align with the evolution of PHP. Possibly not a top priority, understandably, but also something that can be done specially having a volunteer already jumping in. Thoughts?
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2022-05-30 12:03:35 |
Closed_By | ⇒ | laoneo |
I'm closing this as it is an issue on the parser side.
As far as I can tell from the PHP RFC https://wiki.php.net/rfc/match_expression_v2
We're using it in a method name here which means everything works fine. Given that this is a public method available for extension developers to use I'm not sure that we really want to change the function name - certainly we would have to keep the original in J4 as an alias even if we did set a new name