Skip to content
Browse files

Fixed bug #19478 : Incorrect indent detection in PEAR standard

  • Loading branch information...
1 parent 2e78725 commit d269206f5fca287b277c832fd02bcfcf55378b4a @gsherwood gsherwood committed
View
6 CodeSniffer/Standards/PEAR/Sniffs/Functions/FunctionCallSignatureSniff.php
@@ -216,6 +216,12 @@ public function processMultiLineCall(PHP_CodeSniffer_File $phpcsFile, $stackPtr,
continue;
}
+ // Check if the next line contains an object operator, if so rely on
+ // the ObjectOperatorIndentSniff to test the indent.
+ if ($tokens[$nextCode]['type'] === 'T_OBJECT_OPERATOR') {
+ continue;
+ }
+
if ($nextCode === $closeBracket) {
// Closing brace needs to be indented to the same level
// as the function call.
View
10 CodeSniffer/Standards/PEAR/Tests/Functions/FunctionCallSignatureUnitTest.inc
@@ -104,4 +104,14 @@ $foo = new stdClass(
1,
2,
3);
+
+public function doSomething()
+{
+ return $this->getFoo()
+ ->doBar(
+ $this->getX() // no comma here
+ ->doY() // this is still the first method argument
+ ->doZ() // this is still the first method argument
+ );
+}
?>
View
2 package.xml
@@ -49,6 +49,8 @@ http://pear.php.net/dtd/package-2.0.xsd">
- Fixed bug #19469 : PHP_CodeSniffer_File::getMemberProperties() sets wrong scope
- Fixed bug #19471 : phpcs on Windows, when using Zend standard, doesn't catch problems
-- Thanks to Ivan Habunek for the patch
+ - Fixed bug #19478 : Incorrect indent detection in PEAR standard
+ -- Thanks to Shane Auckland
- Fixed bug #19483 : Blame Reports fail with space in directory name
</notes>
<contents>

0 comments on commit d269206

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