Skip to content

Commit 6bb776f

Browse files
committed
ParentCallSpacingSniff: Fixed false positive
1 parent 67b779b commit 6bb776f

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

SlevomatCodingStandard/Sniffs/Classes/ParentCallSpacingSniff.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ public function process(File $phpcsFile, $parentPointer): void
5252
$tokensToIgnore = array_merge(
5353
Tokens::$assignmentTokens,
5454
Tokens::$equalityTokens,
55+
Tokens::$booleanOperators,
5556
[T_RETURN, T_YIELD, T_YIELD_FROM, T_OPEN_SHORT_ARRAY]
5657
);
5758
if (in_array($tokens[$previousPointer]['code'], $tokensToIgnore, true)) {

tests/Sniffs/Classes/data/parentCallSpacingNoErrors.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,4 +45,8 @@ function i() {
4545
return [parent::f()];
4646
}
4747

48+
function j() {
49+
return doAnything() && parent::j();
50+
}
51+
4852
}

0 commit comments

Comments
 (0)