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
I ran into a strange case where our array sniff for PHP CodeSniffer does not detect a value that's part of a nested array and hence does not enforce a missing trailing comma. Here's a code snippet for reproducing this:
<?php$a = [
'bla' => [
'blubb'// <-- This line is missing a trailing comma!
],
];
I wasn't able to come up with an quick easy fix, because the code that collects the array values is mixed with the code that validates key/value pairs (which IMHO is not necessary at all, since php -l validates keyed arrays):
I ran into a strange case where our
array
sniff for PHP CodeSniffer does not detect a value that's part of a nested array and hence does not enforce a missing trailing comma. Here's a code snippet for reproducing this:I wasn't able to come up with an quick easy fix, because the code that collects the array values is mixed with the code that validates key/value pairs (which IMHO is not necessary at all, since
php -l
validates keyed arrays):https://github.com/VIISON/style-guide/blob/6ae0a65a3fb21bb5e80f5276c4fa7b81681a695d/php/php-codesniffer-standard/VIISON/Sniffs/Arrays/ArrayDeclarationSniff.php#L348-L501
The text was updated successfully, but these errors were encountered: