Closed jnoordsij closed 9 months ago
I encountered the same bug today, looking forward a fix! :wave:
Same problem, for now I'm ignoring my Enum folder.
Hello, same problem
public const string VALUE = 'value';
phpcs: Class constants must be uppercase; expected STRING but found string
Any news on that?
@PatNowak Please take a moment to read; https://github.com/squizlabs/PHP_CodeSniffer/issues/3932
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.