Skip to content

Commit 32fb2ec

Browse files
author
Vincent Langlet
committed
🐛 Fix rule
1 parent 2784d0b commit 32fb2ec

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Symfony3Custom/Sniffs/Formatting/ConditionalReturnOrThrowSniff.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,10 +74,10 @@ public function process(File $phpcsFile, $stackPtr)
7474
? $tokens[$condition]['scope_closer'] < $tokens[$next]['scope_opener']
7575
: $tokens[$condition]['line'] <= $tokens[$next]['line'];
7676
} else {
77-
$err = false;
77+
$err = $tokens[$condition]['level'] === $tokens[$opener]['level'];
7878
}
7979

80-
if (false === $next || true === $err) {
80+
if ($err) {
8181
$phpcsFile->addError(
8282
'Do not use else, elseif, break after if and case conditions which return or throw something',
8383
$condition,

0 commit comments

Comments
 (0)