Skip to content
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

Generic.PHP.LowerCaseKeyword: cases and constants named empty or isset identified as PHP keywords in 3.7.0 #3611

Closed
janedbal opened this issue Jun 13, 2022 · 4 comments

Comments

@janedbal
Copy link

Describe the bug
Following symbols are identified as keywords:

Code sample

class SomeClass
{
    public const EMPTY = 0; // PHP keywords must be lowercase; expected "empty" but found "EMPTY" (Generic.PHP.LowerCaseKeyword.Found)
    public const ISSET = 1; // PHP keywords must be lowercase; expected "isset" but found "ISSET" (Generic.PHP.LowerCaseKeyword.Found)
}
enum MyEnum: string
{
    case Empty = 'empty'; // PHP keywords must be lowercase; expected "empty" but found "Empty" (Generic.PHP.LowerCaseKeyword.Found)
    case Isset = 'isset'; // PHP keywords must be lowercase; expected "isset" but found "Isset" (Generic.PHP.LowerCaseKeyword.Found)
}

Expected behavior
No errors

Versions (please complete the following information):

  • PHP: 8.1
  • PHPCS: 3.7.0
@jrfnl
Copy link
Contributor

jrfnl commented Jun 13, 2022

Duplicate of #3609, which has already been fixed via #3610.

@janedbal
Copy link
Author

I was not sure if the root cause is the same, thanks!

@jrfnl
Copy link
Contributor

jrfnl commented Jun 13, 2022

@janedbal It is.

@janedbal
Copy link
Author

Ok, closing then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants