Skip to content

Commit

Permalink
Fixed bug #19629 : PSR2 error for inline comments on multi-line argum…
Browse files Browse the repository at this point in the history
…ent lists
  • Loading branch information
gsherwood committed Oct 2, 2012
1 parent 1499c30 commit ab6a5a1
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 3 deletions.
Expand Up @@ -282,7 +282,7 @@ public function processMultiLineCall(PHP_CodeSniffer_File $phpcsFile, $stackPtr,

if ($this->allowMultipleArguments === false && $tokens[$i]['code'] === T_COMMA) {
// Comma has to be the last token on the line.
$next = $phpcsFile->findNext(T_WHITESPACE, ($i + 1), $closeBracket, true);
$next = $phpcsFile->findNext(array(T_WHITESPACE, T_COMMENT), ($i + 1), $closeBracket, true);
if ($next !== false
&& $tokens[$i]['line'] === $tokens[$next]['line']
) {
Expand Down
Expand Up @@ -152,6 +152,12 @@ public function doSomething()
);
}

doError(
404, // status code
'Not Found', // error name
'Check your id' // fix
);

// @codingStandardsChangeSetting PEAR.Functions.FunctionCallSignature allowMultipleArguments true

// Don't report errors for closing braces. Leave that to other sniffs.
Expand Down
Expand Up @@ -67,8 +67,8 @@ public function getErrorList()
129 => 1,
137 => 1,
142 => 2,
165 => 1,
197 => 1,
171 => 1,
203 => 1,
);

}//end getErrorList()
Expand Down
1 change: 1 addition & 0 deletions package.xml
Expand Up @@ -27,6 +27,7 @@ http://pear.php.net/dtd/package-2.0.xsd">
<license uri="http://matrix.squiz.net/developer/tools/php_cs/licence">BSD License</license>
<notes>
- Fixed bug #19616 : Nested switches cause false error in PSR2
- Fixed bug #19629 : PSR2 error for inline comments on multi-line argument lists
</notes>
<contents>
<dir name="/">
Expand Down

0 comments on commit ab6a5a1

Please sign in to comment.