Permalink
Browse files

Merge pull request #611 from elkuku/sniff-fixes

Code style: Modify the FunctionCallSignatureSniff
  • Loading branch information...
2 parents 3789469 + 59f1551 commit a3517f259efacce47f5cee18aeb987c76220d369 @eddieajau eddieajau committed Dec 6, 2011
Showing with 7 additions and 2 deletions.
  1. +7 −2 build/phpcs/Joomla/Sniffs/Functions/FunctionCallSignatureSniff.php
@@ -234,13 +234,18 @@ public function processMultiLineCall(PHP_CodeSniffer_File $phpcsFile, $stackPtr,
}
}//end for
- if ($tokens[($openBracket + 1)]['content'] !== $phpcsFile->eolChar) {
+ if ($tokens[($openBracket + 1)]['content'] !== $phpcsFile->eolChar
+ && T_CONSTANT_ENCAPSED_STRING != $tokens[($openBracket + 1)]['code'])// allow a '"'
+ {
$error = 'Opening parenthesis of a multi-line function call must be the last content on the line';
$phpcsFile->addError($error, $stackPtr, 'ContentAfterOpenBracket');
}
$prev = $phpcsFile->findPrevious(T_WHITESPACE, ($closeBracket - 1), null, true);
- if ($tokens[$prev]['line'] === $tokens[$closeBracket]['line']) {
+
+ if ($tokens[$prev]['line'] === $tokens[$closeBracket]['line']
+ && T_CONSTANT_ENCAPSED_STRING != $tokens[$prev]['code'])// allow a '"'
+ {
$error = 'Closing parenthesis of a multi-line function call must be on a line by itself';
$phpcsFile->addError($error, $closeBracket, 'CloseBracketLine');
}

0 comments on commit a3517f2

Please sign in to comment.