You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Updates needed to the predefined token collections in the Tokens class
Updates needed to utility functions - getMemberProperties(), getMethodParameters() (for constructor property promotion)
These updates should include special handling for the abbreviated form.
Updates needed to abstract sniffs ?
This needs investigation, but I imagine the AbstractScopeSniff and the AbstractVariableSniff might need updates.
Proposal needed on how to handle this for the tokenizer
Tokenizer changes needed
Updates needed to utility functions - getMemberProperties()
Sniff updates needed
Property hooks - hook syntax. other short form variations
Proposal needed on how to handle this for the tokenizer
Tokenizer changes needed
Updates needed to utility functions - getMemberProperties()
Sniff updates needed
Property hooks - hook syntax for abstract properties/interface properties (no body)
Proposal needed on how to handle this for the tokenizer
Tokenizer changes needed
Updates needed to utility functions ?
Sniff updates needed
Property hooks - hook syntax in constructor property promotion, long form
Tokenizer changes needed
Updates needed to utility functions - getMethodParameters()
Sniff updates needed
Property hooks - hook syntax in constructor property promotion, short form
Tokenizer changes needed
Updates needed to utility functions - getMethodParameters()
Sniff updates needed
Property hooks - availability of "magic" variable within hook functions
Updates needed to utility functions ? - getMethodParameters() ?
Sniff updates needed ?
Done
Nothing yet.
No action needed
Transform exit() from a language construct into a standard function @jrfnl I've reviewed and ran tests with this change at the time as it isn't a new syntax, but a change to an existing syntax with a high probability to break existing sniffs. Based on the final implementation of the change, no changes to support this in PHPCS were needed.
Contribution Process
If anyone familiar with the PHP and PHPCS tokenizer wants to start work on any of these, please leave a comment in this ticket to claim an action item.
If you are not familiar with either tokenizer, please spare yourself the pain 😉
New custom PHPCS tokens may be needed (like for supporting property hooks). If that's the case, please open a separate issue with a detailed proposal on how to handle the syntax, what alternatives have been considered, what the consequences would be and why the proposed option should be accepted. Please open this issue before creating a PR.
If anyone needs it, here are some examples of earlier proposals for supporting PHP syntaxes from before PHP 8.4:
For anyone coming to this ticket to see when syntax support for PHP 8.4 syntaxes is expected, please do NOT spam this ticket with repeated comments asking for a timeline. It will be ready when it's ready and whatever is ready will be included in a release forthwith.
Seriously, to add syntax support for PHP 8.4, a completely silly amount of work will be needed and people need to sleep once in a while as well (and should get a life), so please be patient.
... property hooks is the bane of my existence and will be a nightmare to add support for in PHPCS. The tokenizer support alone is going to take months of work, as it is not 1 syntax they have added, but over a dozen new syntaxes, all under one RFC...
Only after syntax support is available through the Tokenizer can we start fixing individual sniffs and I expect 60-70% of sniffs in the wider PHPCS field (including external standards) will need updates, or at the very least additional tests with property hooks.
I spoke up about this at the time (and about other idiocracies in property hooks, it's a massive footgun), but unfortunately to no avail.
If you want to read my full analysis of the problems with property hooks, have a read through here: https://externals.io/message/123048#123080
Oh and this comment from me on the Internals mailinglist should also help illuminate why so many sniffs will need updates and how problematic property hooks are: https://externals.io/message/123048#123118
All in all, please be patient, I expect it will be quite a while before PHPCS will have full support for property hooks.
PHP 8.4 introduces new syntaxes for which it should be verified if the Tokenizer needs updates and/or whether any sniffs need updating.
Action list
Notes:
To Do
Tokens
classgetMemberProperties()
,getMethodParameters()
(for constructor property promotion)These updates should include special handling for the abbreviated form.
This needs investigation, but I imagine the
AbstractScopeSniff
and theAbstractVariableSniff
might need updates.final
propertiesgetMemberProperties()
,getMethodParameters()
(for constructor property promotion)abstract
propertiesgetMemberProperties()
,getMethodParameters()
(for constructor property promotion)getMemberProperties()
,getMethodParameters()
(for constructor property promotion)getMemberProperties()
getMemberProperties()
getMemberProperties()
getMethodParameters()
getMethodParameters()
getMethodParameters()
?Done
Nothing yet.
No action needed
@jrfnl I've reviewed and ran tests with this change at the time as it isn't a new syntax, but a change to an existing syntax with a high probability to break existing sniffs. Based on the final implementation of the change, no changes to support this in PHPCS were needed.
Contribution Process
If anyone familiar with the PHP and PHPCS tokenizer wants to start work on any of these, please leave a comment in this ticket to claim an action item.
If you are not familiar with either tokenizer, please spare yourself the pain 😉
New custom PHPCS tokens may be needed (like for supporting property hooks). If that's the case, please open a separate issue with a detailed proposal on how to handle the syntax, what alternatives have been considered, what the consequences would be and why the proposed option should be accepted. Please open this issue before creating a PR.
If anyone needs it, here are some examples of earlier proposals for supporting PHP syntaxes from before PHP 8.4:
yield from
tokenization #529 (comment)Timeline
For anyone coming to this ticket to see when syntax support for PHP 8.4 syntaxes is expected, please do NOT spam this ticket with repeated comments asking for a timeline.
It will be ready when it's ready and whatever is ready will be included in a release forthwith.
Seriously, to add syntax support for PHP 8.4, a completely silly amount of work will be needed and people need to sleep once in a while as well (and should get a life), so please be patient.
To quote myself from #731 (comment):
The text was updated successfully, but these errors were encountered: