-
-
Notifications
You must be signed in to change notification settings - Fork 493
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
Trailing comma on array declaration #5
Comments
Thanks for flagging this up Gary, I'll have a look this later this week. |
This sniff is actually from the Squiz standard, but it has a few IF statements commented out, which are producing the error. If you have a way to reproduce the issue using the sniff included from the Squiz standard, please submit a bug report for PHP_CodeSniffer. |
Running PHPCS against the same file with the Squiz standard did NOT produce the error above. |
Probably duplicate of #9 and caused by parenthesis. |
Fixed in #59 |
Originally reported at http://pear.php.net/bugs/bug.php?id=19162 but as https://github.com/pear/PHP_CodeSniffer/tree/master/CodeSniffer/Standards/PEAR/Sniffs doesn't appear to have a Arrays directory (as I assumed the WP were adapted from the PEAR CS) then it's worth reporting here too.
Description:
Running PHP_CodeSniffer via a phing build on Jenkins, I get that one of the arrays has no trailing comma, yet I believe it has.
It's only a single item in the array, and the value of it is multiple nested function calls which itself includes an array.
I've got a similar bit of code lower down in my file which also produces the same error.
Test script:
Expected result:
I'd expect no array trailing comma warning to appear.
Actual result:
class-tgm-plugin-activation.php:1179, ArrayDeclaration, Priority: High
Each line in an array declaration must end in a comma
The text was updated successfully, but these errors were encountered: