-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Does not work with readonly classes introduced in PHP 8.2 #3727
Comments
Thanks for reporting this. PR #3686 would not fix this, though I have a number of follow-up commits waiting on #3686 to be merged to add support for |
@jrfnl |
There is a bug when dealing with readonly class. See squizlabs/PHP_CodeSniffer#3727 This commit will temporary exclude PSR1.Files.SideEffects.FoundWithSymbols
This is to satisfy some scanners looking for one. I mean, it's Easter, after all. The `FourOhFourButFound` class could be marked as `readonly` but the code sniffer doesn't yet support readonly classes, see squizlabs/PHP_CodeSniffer#3727.
PHP 8.2 beta came out July 21, 2022. The first RC came out on Sep 1. The official stable release was on Dec 8, 2022. And here we are, April 30, 2023, and we still have to choose between dropping PHP_CodeSniffer and actually making use of the readonly classes feature. |
@still-dreaming-1 Have you tried contributing ? |
@jrfnl Would contributing help though? There are so many pull requests already waiting (you seem to have already fixed this issue for quite some time, for example, thanks for that!) and no avenue to help out or indication what would help. I would donate some money for the project or for a maintainer (as I do for other open source projects), but there is no information about that either. It does seem that this project is somehow stuck. |
@iquito We're working on getting it unstuck, but comments like the one I responded to are not helpful and highly demotivating. |
Another |
I've merged the fix. Thanks for the bug report. |
@gsherwood Is this something that you could tag soon? It'd be nice to stop disabling the busted rule |
@jrfnl @gsherwood any ETA on getting this out? |
Just ran into this myself; any chance for a new release of PHPCS? Thank you for considering! |
How can we help to tag this hotfix ? |
@alamirault There's nothing anyone can do, but wait patiently for @gsherwood to have some time again. Also see: #3861 |
FYI: the fix for this issue is included in today's PHP_CodeSniffer 3.8.0 release. As per #3932, development on PHP_CodeSniffer will continue in the PHPCSStandards/PHP_CodeSniffer repository. If you want to stay informed, you may want to start "watching" that repo (or watching releases from that repo). |
May be closed by
#3686#3728Describe the bug
In PHP 8.2, "readonly class" feature was introduced.
Using readonly classes, we can shorten readonly property declarations as follows:
equals to:
However, the latest version of phpcs v3.7.1 does not work on the classes which are marked as "readonly". (The phpcs error output is in "To reproduce" section)
Code sample
Custom ruleset
N/A
To reproduce
Steps to reproduce the behavior:
Expected behavior
A clear and concise description of what you expected to happen.
Versions (please complete the following information):
Additional context
N/A
The text was updated successfully, but these errors were encountered: