Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support new PHP 8.4 syntaxes #734

Open
1 of 43 tasks
jrfnl opened this issue Nov 26, 2024 · 0 comments
Open
1 of 43 tasks

Support new PHP 8.4 syntaxes #734

jrfnl opened this issue Nov 26, 2024 · 0 comments

Comments

@jrfnl
Copy link
Member

jrfnl commented Nov 26, 2024

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:

  • While Property Hooks is a single RFC, it introduces multiple new syntaxes. With that in mind, I've broken the RFC up into separately actionable parts.
  • Action items in italics are tentative. Investigation and testing is needed to determine whether any changes are needed and if so, which.
  • For action items not in italics, I'm fairly certain those will be needed.
  • This list is not set in stone and is subject to change once investigation for supporting a syntax starts.

To Do

Done

Nothing yet.

No action 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:

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):

... 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.

Funding for this would help. Finding a way to clone me, would help even more.

@jrfnl jrfnl pinned this issue Nov 26, 2024
DanielEScherzer added a commit to DanielEScherzer/PHP_CodeSniffer that referenced this issue Feb 19, 2025
jrfnl pushed a commit that referenced this issue Feb 21, 2025
Update File::getMemberProperties() to report when a property is marked as final. Update existing tests (which are all for non-final properties) to expect that the property not be marked as final, and add a new test case for a final that should be, and is, marked as final.

Part of #734
jrfnl pushed a commit that referenced this issue Feb 21, 2025
Update File::getMemberProperties() to report when a property is marked as final. Update existing tests (which are all for non-final properties) to expect that the property not be marked as final, and add a new test case for a final that should be, and is, marked as final.

Part of #734
jrfnl pushed a commit that referenced this issue Feb 21, 2025
Update File::getMemberProperties() to report when a property is marked as final. Update existing tests (which are all for non-final properties) to expect that the property not be marked as final, and add a new test case for a final that should be, and is, marked as final.

Part of #734
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant