You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
phpcs parse const name as keyword, and expect its lowercase. But its legal const name not restricted by php or by standard.
Yep, in other context its keyword, but its allowed to use it as const name.
If in some reason you decide what its not allowed -> it will show relevant error, not about "lowercase'.
Create a file called Node.php with the code sample above...
Run phpcs --standart=PSR12 Node.php
See error message displayed
------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
------------------------------------------------------------------------------------
9 | ERROR | [x] PHP keywords must be lowercase; expected "empty" but found "EMPTY"
------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------------
Expected behavior
No error, or (if its restricted by standard) warning about reserved word
Versions:
OS: Linux
PHP: 7.1
PHPCS: 3.7.0
Standard: PSR12
The text was updated successfully, but these errors were encountered:
Describe the bug
phpcs parse const name as keyword, and expect its lowercase. But its legal const name not restricted by php or by standard.
Yep, in other context its keyword, but its allowed to use it as const name.
If in some reason you decide what its not allowed -> it will show relevant error, not about "lowercase'.
Code sample
To reproduce
Steps to reproduce the behavior:
Node.php
with the code sample above...phpcs --standart=PSR12 Node.php
Expected behavior
No error, or (if its restricted by standard) warning about reserved word
Versions:
The text was updated successfully, but these errors were encountered: