Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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

…ent lists
  • Loading branch information...
commit ab6a5a11f8960f527a0debba0ae3e9e40d31a752 1 parent 1499c30
Greg Sherwood authored October 02, 2012
2  CodeSniffer/Standards/PEAR/Sniffs/Functions/FunctionCallSignatureSniff.php
@@ -282,7 +282,7 @@ public function processMultiLineCall(PHP_CodeSniffer_File $phpcsFile, $stackPtr,
282 282
 
283 283
             if ($this->allowMultipleArguments === false && $tokens[$i]['code'] === T_COMMA) {
284 284
                 // Comma has to be the last token on the line.
285  
-                $next = $phpcsFile->findNext(T_WHITESPACE, ($i + 1), $closeBracket, true);
  285
+                $next = $phpcsFile->findNext(array(T_WHITESPACE, T_COMMENT), ($i + 1), $closeBracket, true);
286 286
                 if ($next !== false
287 287
                     && $tokens[$i]['line'] === $tokens[$next]['line']
288 288
                 ) {
6  CodeSniffer/Standards/PEAR/Tests/Functions/FunctionCallSignatureUnitTest.inc
@@ -152,6 +152,12 @@ public function doSomething()
152 152
         );
153 153
 }
154 154
 
  155
+doError(
  156
+    404, // status code
  157
+    'Not Found', // error name
  158
+    'Check your id' // fix
  159
+);
  160
+
155 161
 // @codingStandardsChangeSetting PEAR.Functions.FunctionCallSignature allowMultipleArguments true
156 162
 
157 163
 // Don't report errors for closing braces. Leave that to other sniffs.
4  CodeSniffer/Standards/PEAR/Tests/Functions/FunctionCallSignatureUnitTest.php
@@ -67,8 +67,8 @@ public function getErrorList()
67 67
                 129 => 1,
68 68
                 137 => 1,
69 69
                 142 => 2,
70  
-                165 => 1,
71  
-                197 => 1,
  70
+                171 => 1,
  71
+                203 => 1,
72 72
                );
73 73
 
74 74
     }//end getErrorList()
1  package.xml
@@ -27,6 +27,7 @@ http://pear.php.net/dtd/package-2.0.xsd">
27 27
  <license uri="http://matrix.squiz.net/developer/tools/php_cs/licence">BSD License</license>
28 28
  <notes>
29 29
   - Fixed bug #19616 : Nested switches cause false error in PSR2
  30
+  - Fixed bug #19629 : PSR2 error for inline comments on multi-line argument lists
30 31
  </notes>
31 32
  <contents>
32 33
   <dir name="/">

0 notes on commit ab6a5a1

Please sign in to comment.
Something went wrong with that request. Please try again.