-
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
PHP 8.3 - Typed class constants support #3927
Comments
I encountered the same bug today, looking forward a fix! 👋 |
Same problem, for now I'm ignoring my Enum folder. |
Hello, same problem
phpcs: Class constants must be uppercase; expected STRING but found string |
Any news on that? |
FYI: a fix for this issue is included in today's PHP_CodeSniffer 3.9.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). |
Describe the bug
PHP 8.3 allows defining a type for class constants (see https://php.watch/versions/8.3/typed-constants) to enforce compatibility with overrides and have better static analysis support.
When using this with current stable
phpcs
, this triggers an error message like:Code sample
Custom ruleset
To reproduce
Steps to reproduce the behavior:
test.php
with the code sample above...phpcs test.php ...
Expected behavior
No error.
Versions (please complete the following information)
Please confirm:
master
branch of PHP_CodeSniffer.The text was updated successfully, but these errors were encountered: