Skip to content

Commit 80f953c

Browse files
committed
Squiz/IncrementDecrementUsage: suggest pre-in/decrement
... rather than post in/decrement. Fixes 2354
1 parent 49a3e26 commit 80f953c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Standards/Squiz/Sniffs/Operators/IncrementDecrementUsageSniff.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ protected function processAssignment($phpcsFile, $stackPtr)
205205
}
206206
}
207207

208-
$expected = $tokens[$assignedVar]['content'].$operator.$operator;
208+
$expected = $operator.$operator.$tokens[$assignedVar]['content'];
209209
$found = $phpcsFile->getTokensAsString($assignedVar, ($statementEnd - $assignedVar + 1));
210210

211211
if ($operator === '+') {

0 commit comments

Comments
 (0)