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
However, the current sniff being used to check this convention - PEAR.NamingConventions.ValidClassName - allows for both PascalCase as well as Camel_Caps (the difference being in the underscore enforcement).
I would expect all four lines to get an error for the names not being in Camel_Caps, however, only the snake_case name is being flagged with the following two errors:
ERROR | [ ] Trait name must begin with a capital letter (PEAR.NamingConventions.ValidClassName.StartWithCapital)
ERROR | [ ] Trait name is not valid; consider Snake_Case instead (PEAR.NamingConventions.ValidClassName.Invalid)
Environment
Question
Answer
PHP version
irrelevant
PHP_CodeSniffer version
master + extras
WPCS version
develop
WPCS install type
git clone
Additional Context (optional)
I don't think this is an urgent issue, but I did feel it should be recorded that this behaviour is happening and should be looked into at some point in the future.
Tested Against develop branch?
I have verified the issue still exists in the develop branch of WPCS.
The text was updated successfully, but these errors were encountered:
Bug Description
According to the handbook:
Ref: https://developer.wordpress.org/coding-standards/wordpress-coding-standards/php/#naming-conventions
However, the current sniff being used to check this convention -
PEAR.NamingConventions.ValidClassName
- allows for bothPascalCase
as well asCamel_Caps
(the difference being in the underscore enforcement).Minimal Code Snippet
The issue happens when running this command:
... over a file containing this code:
I would expect all four lines to get an error for the names not being in
Camel_Caps
, however, only thesnake_case
name is being flagged with the following two errors:Environment
master
+ extrasdevelop
Additional Context (optional)
I don't think this is an urgent issue, but I did feel it should be recorded that this behaviour is happening and should be looked into at some point in the future.
Tested Against
develop
branch?develop
branch of WPCS.The text was updated successfully, but these errors were encountered: