-
-
Notifications
You must be signed in to change notification settings - Fork 60
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 PHP 8.4 property hooks #731
Comments
@jnoordsij Thanks for the reminder, yes, I should open a PHP 8.4 syntax support issue. Having said that, 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... 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. 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. |
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 |
I've now opened the PHP 8.4 syntax overview ticket: #734 I think it would be a good idea to close this ticket in favour of the overview ticket. |
Thanks a lot for your detailed explanation on the issue at hand, and also on all the time you spent on this earlier in the process trying to raise your concerns. I can only imagine how hard getting up-to-date with this amount of new syntax can be, so I fully understand that it might be a very lengthy process before this lands. My main reason for raising this issue was mostly to have a place to track progress for future reference, both for me and others. I think #734 is a perfect overview to find that now, so I'll gladly close this in favor of that! |
@jnoordsij Thank you for your understanding. |
Is your feature request related to a problem?
Describe the solution you'd like
PHP 8.4 has been recently released, introducing property hooks which allows for easier customization to get and set logic of properties.
This new syntax yields some errors when linted with current setup. A small example I've created:
When running
phpcs --standard=PSR12 foo.php
this yieldsI'd expect no errors linting this.
Additional context (optional)
There might be additional new PHP 8.4 syntax that require additional changes. Maybe this should be listed on #106 or a new tracking issue for PHP 8.4 syntax? I could not find an existing source for tracking 8.4 compatibility.
The text was updated successfully, but these errors were encountered: