Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixed bug #19629 : PSR2 error for inline comments on multi-line argum…

…ent lists
  • Loading branch information...
commit ab6a5a11f8960f527a0debba0ae3e9e40d31a752 1 parent 1499c30
Greg Sherwood gsherwood authored
2  CodeSniffer/Standards/PEAR/Sniffs/Functions/FunctionCallSignatureSniff.php
View
@@ -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']
) {
6 CodeSniffer/Standards/PEAR/Tests/Functions/FunctionCallSignatureUnitTest.inc
View
@@ -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.
4 CodeSniffer/Standards/PEAR/Tests/Functions/FunctionCallSignatureUnitTest.php
View
@@ -67,8 +67,8 @@ public function getErrorList()
129 => 1,
137 => 1,
142 => 2,
- 165 => 1,
- 197 => 1,
+ 171 => 1,
+ 203 => 1,
);
}//end getErrorList()
1  package.xml
View
@@ -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="/">
Please sign in to comment.
Something went wrong with that request. Please try again.