From ad9a0b2df4c15f78e2b02808577d986968a7eb74 Mon Sep 17 00:00:00 2001 From: Rodrigo Primo Date: Fri, 13 Jun 2025 12:06:35 -0300 Subject: [PATCH] Filter/Filter: remove outdated code that is no longer needed This commit removes an if condition to maintain backwards compatibility that is no longer needed. It was added via https://github.com/squizlabs/PHP_CodeSniffer/commit/4982619b53bf7cea6255bc1dac57b89096c046f4 to preserve backwards compatibility back in a time when it was possible to programmatically set ignore patterns using `CodeSniffer::setIgnorePatterns()` (see https://pear.php.net/bugs/bug.php?id=19859). This method was removed a long time ago via https://github.com/PHPCSStandards/PHP_CodeSniffer/commit/f61025c5617a493b655a5f572a3e13749b3a51f8#diff-c36ecedca179eab0b3cd245e872a96ab26fa08e567437e167f4eda1779c15c89L431-L435, and since then, there is no way for users to set the ignore pattern array with numeric indices. --- src/Filters/Filter.php | 7 ------- 1 file changed, 7 deletions(-) diff --git a/src/Filters/Filter.php b/src/Filters/Filter.php index 8376d15c3b..12cafa7d0a 100644 --- a/src/Filters/Filter.php +++ b/src/Filters/Filter.php @@ -247,13 +247,6 @@ protected function shouldIgnorePath($path) } foreach ($ignorePatterns as $pattern => $type) { - // Maintains backwards compatibility in case the ignore pattern does - // not have a relative/absolute value. - if (is_int($pattern) === true) { - $pattern = $type; - $type = 'absolute'; - } - $replacements = [ '\\,' => ',', '*' => '.*',