File tree Expand file tree Collapse file tree 1 file changed +15
-1
lines changed
Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -1691,6 +1691,21 @@ private function parseSniffCodes($input, $argument)
16911691 }
16921692 }//end foreach
16931693
1694+ $ sniffs = array_reduce ($ sniffs , static function ($ carry , $ item ) {
1695+ $ lower = strtolower ($ item );
1696+
1697+ foreach ($ carry as $ found ) {
1698+ if ($ lower === strtolower ($ found )) {
1699+ // This sniff is already in our list.
1700+ return $ carry ;
1701+ }
1702+ }
1703+
1704+ $ carry [] = $ item ;
1705+
1706+ return $ carry ;
1707+ }, []);
1708+
16941709 if ($ errors !== []) {
16951710 $ error = 'ERROR: The -- ' .$ argument .' option only supports sniff codes. ' .PHP_EOL ;
16961711 $ error .= 'Sniff codes are in the form "Standard.Category.Sniff" ' .PHP_EOL ;
@@ -1699,7 +1714,6 @@ private function parseSniffCodes($input, $argument)
16991714 $ error .= '* ' .implode (PHP_EOL .'* ' , $ errors ).PHP_EOL ;
17001715
17011716 if ($ sniffs !== []) {
1702- $ sniffs = array_unique ($ sniffs );
17031717 $ error .= PHP_EOL ;
17041718 $ error .= 'Perhaps try -- ' .$ argument .'=" ' .implode (', ' , $ sniffs ).'" instead. ' .PHP_EOL ;
17051719 }
You can’t perform that action at this time.
0 commit comments