diff --git a/.gitignore b/.gitignore index e03d470050..c18271e954 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ .DS_Store *.sw* +tags diff --git a/Sniffs/Arrays/ArrayDeclarationSniff.php b/Sniffs/Arrays/ArrayDeclarationSniff.php index bec7323023..195ef18fd0 100755 --- a/Sniffs/Arrays/ArrayDeclarationSniff.php +++ b/Sniffs/Arrays/ArrayDeclarationSniff.php @@ -428,7 +428,7 @@ public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr) */ // Check each line ends in a comma. if ($tokens[$index['value']]['code'] !== T_ARRAY) { - $nextComma = $phpcsFile->findNext(array(T_COMMA), ($index['value'] + 1)); + $nextComma = $phpcsFile->findNext(array(T_COMMA, T_OPEN_PARENTHESIS), ($index['value'] + 1)); if (($nextComma === false) || ($tokens[$nextComma]['line'] !== $tokens[$index['value']]['line'])) { $error = 'Each line in an array declaration must end in a comma'; $phpcsFile->addError($error, $index['value']);