squizlabs / PHP_CodeSniffer

PHP_CodeSniffer tokenizes PHP files and detects violations of a defined set of coding standards.
BSD 3-Clause "New" or "Revised" License
10.67k stars 1.48k forks source link

enum case NEW is interpreted as a php keyword #3540

Closed ozahorulia closed 2 years ago

ozahorulia commented 2 years ago

Code sample

enum JobStatus: string
{
    case NEW = 'new';
    case SCHEDULED = 'scheduled';
    case PENDING = 'pending';
    case DONE = 'done';
}

Output:

FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------
 9 | ERROR | [x] PHP keywords must be lowercase; expected "new" but found "NEW"
--------------------------------------------------------------------------------

Versions:

jrfnl commented 2 years ago

See PR #3483

ozahorulia commented 2 years ago

Thanks