From e5569b695b87a6d698310c36b2363bc72d8f0972 Mon Sep 17 00:00:00 2001 From: jrfnl Date: Wed, 10 Apr 2024 16:05:56 +0200 Subject: [PATCH] Generic/JumbledIncrementer: fix inconsistency The name of the sniff uses "Incrementer", while the error message uses "Incrementor". This feels inconsistent. Based on some light research, both terms can be used interchangable, so I'm proposing to make the error message consistent with the sniff name, as changing the sniff name would be a breaking change. Includes making the same change in an inline comment. --- .../Generic/Sniffs/CodeAnalysis/JumbledIncrementerSniff.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Standards/Generic/Sniffs/CodeAnalysis/JumbledIncrementerSniff.php b/src/Standards/Generic/Sniffs/CodeAnalysis/JumbledIncrementerSniff.php index 45d9d94464..392dc74c78 100644 --- a/src/Standards/Generic/Sniffs/CodeAnalysis/JumbledIncrementerSniff.php +++ b/src/Standards/Generic/Sniffs/CodeAnalysis/JumbledIncrementerSniff.php @@ -67,7 +67,7 @@ public function process(File $phpcsFile, $stackPtr) return; } - // Find incrementors for outer loop. + // Find incrementers for outer loop. $outer = $this->findIncrementers($tokens, $token); // Skip if empty. @@ -88,7 +88,7 @@ public function process(File $phpcsFile, $stackPtr) $diff = array_intersect($outer, $inner); if (count($diff) !== 0) { - $error = 'Loop incrementor (%s) jumbling with inner loop'; + $error = 'Loop incrementer (%s) jumbling with inner loop'; $data = [implode(', ', $diff)]; $phpcsFile->addWarning($error, $stackPtr, 'Found', $data); }