Closed
Description
Bug Description
Creating a new Anonymous class require Parenthesis but it shouldn't ( i think )
Minimal Code Snippet
return new class implements SomeInterface {}
vs
return new class() implements SomeInterface {}
Error Code
WordPress.Classes.ClassInstantiation.MissingParenthesis
Environment
Question | Answer |
---|---|
PHP version | 7.2.17 |
PHP_CodeSniffer version | 3.4.2 |
WPCS version | 2.1.1 |
WPCS install type | Composer project local |
IDE (if relevant) | VSCode 1.34.0 |
Additional Context (optional)
Tested Against develop
branch?
- I have verified the issue still exists in the
develop
branch of WPCS.
Metadata
Metadata
Assignees
Labels
No labels