Skip to content

Commit 6a3e468

Browse files
committed
Avoid incompatible sniffs running together
Generic.WhiteSpace.ScopeIndent and PSR2.Methods.FunctionCallSignature both try to fix indentation differently. This results in files not being able to be fixed automatically with phpcbf.
1 parent f3a8342 commit 6a3e468

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/Standards/PEAR/Sniffs/Functions/FunctionCallSignatureSniff.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -539,9 +539,10 @@ public function processMultiLineCall(File $phpcsFile, $stackPtr, $openBracket, $
539539
$foundIndent = $tokens[$i]['length'];
540540
}
541541

542-
if ($foundIndent < $expectedIndent
542+
if (($foundIndent < $expectedIndent
543543
|| ($inArg === false
544-
&& $expectedIndent !== $foundIndent)
544+
&& $expectedIndent !== $foundIndent))
545+
&& in_array('Generic.WhiteSpace.ScopeIndent', $phpcsFile->config->sniffs, true) === false
545546
) {
546547
$error = 'Multi-line function call not indented correctly; expected %s spaces but found %s';
547548
$data = [

0 commit comments

Comments
 (0)