From 7c4280bd3c9c5eea986eeff18187349fe8fdf883 Mon Sep 17 00:00:00 2001 From: Payton Swick Date: Sun, 25 Jan 2026 11:27:40 -0500 Subject: [PATCH 01/11] Add phpcsutils as dependency --- composer.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/composer.json b/composer.json index d94d0af..0f0bb98 100644 --- a/composer.json +++ b/composer.json @@ -51,7 +51,8 @@ }, "require": { "php": ">=5.4.0", - "squizlabs/php_codesniffer": "^3.5.7 || ^4.0.0" + "squizlabs/php_codesniffer": "^3.5.7 || ^4.0.0", + "phpcsstandards/phpcsutils": "^1.0" }, "require-dev": { "phpunit/phpunit": "^4.8.36 || ^5.7.21 || ^6.5 || ^7.0 || ^8.0 || ^9.0 || ^10.5.32 || ^11.3.3", From 6a30e89529e174075bf61389da8c3d2db8307b5a Mon Sep 17 00:00:00 2001 From: Payton Swick Date: Sun, 25 Jan 2026 11:29:11 -0500 Subject: [PATCH 02/11] Replace isVariableInsideUnset/isVariableInsideIssetOrEmpty --- VariableAnalysis/Lib/Helpers.php | 33 +++++--------------------------- 1 file changed, 5 insertions(+), 28 deletions(-) diff --git a/VariableAnalysis/Lib/Helpers.php b/VariableAnalysis/Lib/Helpers.php index 8b67f11..17c950e 100644 --- a/VariableAnalysis/Lib/Helpers.php +++ b/VariableAnalysis/Lib/Helpers.php @@ -10,6 +10,7 @@ use VariableAnalysis\Lib\ScopeType; use VariableAnalysis\Lib\VariableInfo; use PHP_CodeSniffer\Util\Tokens; +use PHPCSUtils\Utils\Context; class Helpers { @@ -1333,22 +1334,8 @@ public static function getFunctionIndexForFunctionCallArgument(File $phpcsFile, */ public static function isVariableInsideIssetOrEmpty(File $phpcsFile, $stackPtr) { - $functionIndex = self::getFunctionIndexForFunctionCallArgument($phpcsFile, $stackPtr); - if (! is_int($functionIndex)) { - return false; - } - $tokens = $phpcsFile->getTokens(); - if (! isset($tokens[$functionIndex])) { - return false; - } - $allowedFunctionNames = [ - 'isset', - 'empty', - ]; - if (in_array($tokens[$functionIndex]['content'], $allowedFunctionNames, true)) { - return true; - } - return false; + // Use PHPCSUtils which handles all edge cases across PHP/PHPCS versions + return Context::inIsset($phpcsFile, $stackPtr) || Context::inEmpty($phpcsFile, $stackPtr); } /** @@ -1397,18 +1384,8 @@ public static function isVariableArrayPushShortcut(File $phpcsFile, $stackPtr) */ public static function isVariableInsideUnset(File $phpcsFile, $stackPtr) { - $functionIndex = self::getFunctionIndexForFunctionCallArgument($phpcsFile, $stackPtr); - if (! is_int($functionIndex)) { - return false; - } - $tokens = $phpcsFile->getTokens(); - if (! isset($tokens[$functionIndex])) { - return false; - } - if ($tokens[$functionIndex]['content'] === 'unset') { - return true; - } - return false; + // Use PHPCSUtils which handles all edge cases across PHP/PHPCS versions + return Context::inUnset($phpcsFile, $stackPtr); } /** From 6b1bddab8cb9449de1b23e53abfa32d6732a9877 Mon Sep 17 00:00:00 2001 From: Payton Swick Date: Sun, 25 Jan 2026 11:31:33 -0500 Subject: [PATCH 03/11] Replace findContainingOpeningBracket --- VariableAnalysis/Lib/Helpers.php | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/VariableAnalysis/Lib/Helpers.php b/VariableAnalysis/Lib/Helpers.php index 17c950e..60d0a51 100644 --- a/VariableAnalysis/Lib/Helpers.php +++ b/VariableAnalysis/Lib/Helpers.php @@ -11,6 +11,7 @@ use VariableAnalysis\Lib\VariableInfo; use PHP_CodeSniffer\Util\Tokens; use PHPCSUtils\Utils\Context; +use PHPCSUtils\Utils\Parentheses; class Helpers { @@ -91,15 +92,11 @@ public static function getPreviousStatementPtr(File $phpcsFile, $stackPtr) */ public static function findContainingOpeningBracket(File $phpcsFile, $stackPtr) { - $tokens = $phpcsFile->getTokens(); - if (isset($tokens[$stackPtr]['nested_parenthesis'])) { - /** - * @var list - */ - $openPtrs = array_keys($tokens[$stackPtr]['nested_parenthesis']); - return (int)end($openPtrs); - } - return null; + // Use PHPCSUtils to get the innermost parenthesis opener + $result = Parentheses::getLastOpener($phpcsFile, $stackPtr); + + // PHPCSUtils returns false on failure, but our code expects null + return $result !== false ? $result : null; } /** From 9da451ff8e1dbe2184a8c886039df1fc8d2c3f14 Mon Sep 17 00:00:00 2001 From: Payton Swick Date: Sun, 25 Jan 2026 12:44:57 -0500 Subject: [PATCH 04/11] Simplify arrow function detection by relying on T_FN --- VariableAnalysis/Lib/Helpers.php | 125 ++----------------------------- 1 file changed, 7 insertions(+), 118 deletions(-) diff --git a/VariableAnalysis/Lib/Helpers.php b/VariableAnalysis/Lib/Helpers.php index 60d0a51..41b76b2 100644 --- a/VariableAnalysis/Lib/Helpers.php +++ b/VariableAnalysis/Lib/Helpers.php @@ -647,7 +647,7 @@ public static function getContainingArrowFunctionIndex(File $phpcsFile, $stackPt // We found the closest arrow function before this token. If the token is // within the scope of that arrow function, then return it. - if ($stackPtr > $arrowFunctionInfo['scope_opener'] && $stackPtr < $arrowFunctionInfo['scope_closer']) { + if ($stackPtr >= $arrowFunctionInfo['scope_opener'] && $stackPtr <= $arrowFunctionInfo['scope_closer']) { return $arrowFunctionIndex; } @@ -697,28 +697,7 @@ private static function getPreviousArrowFunctionIndex(File $phpcsFile, $stackPtr public static function isArrowFunction(File $phpcsFile, $stackPtr) { $tokens = $phpcsFile->getTokens(); - if (defined('T_FN') && $tokens[$stackPtr]['code'] === T_FN) { - return true; - } - if ($tokens[$stackPtr]['content'] !== 'fn') { - return false; - } - // Make sure next non-space token is an open parenthesis - $openParenIndex = $phpcsFile->findNext(Tokens::$emptyTokens, $stackPtr + 1, null, true); - if (! is_int($openParenIndex) || $tokens[$openParenIndex]['code'] !== T_OPEN_PARENTHESIS) { - return false; - } - // Find the associated close parenthesis - $closeParenIndex = $tokens[$openParenIndex]['parenthesis_closer']; - // Make sure the next token is a fat arrow - $fatArrowIndex = $phpcsFile->findNext(Tokens::$emptyTokens, $closeParenIndex + 1, null, true); - if (! is_int($fatArrowIndex)) { - return false; - } - if ($tokens[$fatArrowIndex]['code'] !== T_DOUBLE_ARROW && $tokens[$fatArrowIndex]['type'] !== 'T_FN_ARROW') { - return false; - } - return true; + return $tokens[$stackPtr]['code'] === T_FN; } /** @@ -739,108 +718,18 @@ public static function isArrowFunction(File $phpcsFile, $stackPtr) public static function getArrowFunctionOpenClose(File $phpcsFile, $stackPtr) { $tokens = $phpcsFile->getTokens(); - if ($tokens[$stackPtr]['content'] !== 'fn') { - return null; - } - // Make sure next non-space token is an open parenthesis - $openParenIndex = $phpcsFile->findNext(Tokens::$emptyTokens, $stackPtr + 1, null, true); - if (! is_int($openParenIndex) || $tokens[$openParenIndex]['code'] !== T_OPEN_PARENTHESIS) { - return null; - } - // Find the associated close parenthesis - $closeParenIndex = $tokens[$openParenIndex]['parenthesis_closer']; - // Make sure the next token is a fat arrow or a return type - $fatArrowIndex = $phpcsFile->findNext(Tokens::$emptyTokens, $closeParenIndex + 1, null, true); - if (! is_int($fatArrowIndex)) { - return null; - } - if ( - $tokens[$fatArrowIndex]['code'] !== T_DOUBLE_ARROW && - $tokens[$fatArrowIndex]['type'] !== 'T_FN_ARROW' && - $tokens[$fatArrowIndex]['code'] !== T_COLON - ) { - return null; - } - - // Find the scope closer - $scopeCloserIndex = null; - $foundCurlyPairs = 0; - $foundArrayPairs = 0; - $foundParenPairs = 0; - $arrowBodyStart = $tokens[$stackPtr]['parenthesis_closer'] + 1; - $lastToken = self::getLastNonEmptyTokenIndexInFile($phpcsFile); - for ($index = $arrowBodyStart; $index < $lastToken; $index++) { - $token = $tokens[$index]; - if (empty($token['code'])) { - $scopeCloserIndex = $index; - break; - } - - $code = $token['code']; - - // A semicolon is always a closer. - if ($code === T_SEMICOLON) { - $scopeCloserIndex = $index; - break; - } - - // Track pair opening tokens. - if ($code === T_OPEN_CURLY_BRACKET) { - $foundCurlyPairs += 1; - continue; - } - if ($code === T_OPEN_SHORT_ARRAY || $code === T_OPEN_SQUARE_BRACKET) { - $foundArrayPairs += 1; - continue; - } - if ($code === T_OPEN_PARENTHESIS) { - $foundParenPairs += 1; - continue; - } - // A pair closing is only an arrow func closer if there was no matching opening token. - if ($code === T_CLOSE_CURLY_BRACKET) { - if ($foundCurlyPairs === 0) { - $scopeCloserIndex = $index; - break; - } - $foundCurlyPairs -= 1; - continue; - } - if ($code === T_CLOSE_SHORT_ARRAY || $code === T_CLOSE_SQUARE_BRACKET) { - if ($foundArrayPairs === 0) { - $scopeCloserIndex = $index; - break; - } - $foundArrayPairs -= 1; - continue; - } - if ($code === T_CLOSE_PARENTHESIS) { - if ($foundParenPairs === 0) { - $scopeCloserIndex = $index; - break; - } - $foundParenPairs -= 1; - continue; - } - - // A comma is a closer only if we are not inside an opening token. - if ($code === T_COMMA) { - if (empty($foundArrayPairs) && empty($foundParenPairs) && empty($foundCurlyPairs)) { - $scopeCloserIndex = $index; - break; - } - continue; - } + if ($tokens[$stackPtr]['code'] !== T_FN) { + return null; } - if (! is_int($scopeCloserIndex)) { + if (!isset($tokens[$stackPtr]['scope_closer'])) { return null; } return [ - 'scope_opener' => $stackPtr, - 'scope_closer' => $scopeCloserIndex, + 'scope_opener' => $tokens[$stackPtr]['scope_opener'], + 'scope_closer' => $tokens[$stackPtr]['scope_closer'], ]; } From 8683965472531e460b6bcae4a0ee7b16bb454271 Mon Sep 17 00:00:00 2001 From: Payton Swick Date: Sun, 25 Jan 2026 12:45:16 -0500 Subject: [PATCH 05/11] Update phpcs minimum dependency from 3.5.7 to 3.13.5 --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 0f0bb98..b4cf2fa 100644 --- a/composer.json +++ b/composer.json @@ -51,7 +51,7 @@ }, "require": { "php": ">=5.4.0", - "squizlabs/php_codesniffer": "^3.5.7 || ^4.0.0", + "squizlabs/php_codesniffer": "^3.13.5 || ^4.0.0", "phpcsstandards/phpcsutils": "^1.0" }, "require-dev": { From 4a071806355431af8717867fc8c33c6f9f9b759d Mon Sep 17 00:00:00 2001 From: Payton Swick Date: Sun, 25 Jan 2026 12:48:56 -0500 Subject: [PATCH 06/11] Bump min phpcs version to 3.15.5 in GH actions --- .github/workflows/test.yml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b0e8221..ed05ad0 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -36,7 +36,7 @@ jobs: # # The matrix is set up so as not to duplicate the builds which are run for code coverage. php: ["5.5", "5.6", "7.0", "7.1", "7.2", "7.3"] - phpcs_version: ["3.5.7", "4.0.0", "4.x-dev"] + phpcs_version: ["3.13.5", "4.0.0", "4.x-dev"] exclude: # PHPCS 4.x requires PHP 7.2+ @@ -61,32 +61,32 @@ jobs: - php: "8.5" phpcs_version: "4.0.0" - php: "8.5" - phpcs_version: "3.13.4" + phpcs_version: "3.13.5" - php: "8.4" phpcs_version: "4.x-dev" - php: "8.4" - phpcs_version: "3.6.1" + phpcs_version: "3.13.5" - php: "8.3" phpcs_version: "4.x-dev" - php: "8.3" - phpcs_version: "3.6.1" + phpcs_version: "3.13.5" - php: "8.2" phpcs_version: "4.x-dev" - php: "8.2" - phpcs_version: "3.6.1" + phpcs_version: "3.13.5" - php: "8.1" phpcs_version: "4.x-dev" - php: "8.1" - phpcs_version: "3.6.1" + phpcs_version: "3.13.5" - php: "8.0" phpcs_version: "4.x-dev" - php: "8.0" - phpcs_version: "3.5.7" + phpcs_version: "3.13.5" - php: "7.4" phpcs_version: "4.x-dev" @@ -168,12 +168,12 @@ jobs: - php: "8.5" phpcs_version: "4.x-dev" - php: "7.4" - phpcs_version: "3.5.7" + phpcs_version: "3.13.5" - php: "7.2" phpcs_version: "4.x-dev" - php: "5.4" - phpcs_version: "3.5.7" + phpcs_version: "3.13.5" name: "Coverage: PHP ${{ matrix.php }} on PHPCS ${{ matrix.phpcs_version }}" From 4cc7f350ae9dc969eec816eb98229304005b0e8a Mon Sep 17 00:00:00 2001 From: Payton Swick Date: Sun, 25 Jan 2026 13:01:57 -0500 Subject: [PATCH 07/11] Remove unnecessary isArrowFunction block in getScopeCloseForScopeOpen --- VariableAnalysis/Lib/Helpers.php | 6 ------ 1 file changed, 6 deletions(-) diff --git a/VariableAnalysis/Lib/Helpers.php b/VariableAnalysis/Lib/Helpers.php index 41b76b2..8562437 100644 --- a/VariableAnalysis/Lib/Helpers.php +++ b/VariableAnalysis/Lib/Helpers.php @@ -1064,12 +1064,6 @@ public static function getScopeCloseForScopeOpen(File $phpcsFile, $scopeStartInd { $tokens = $phpcsFile->getTokens(); $scopeCloserIndex = isset($tokens[$scopeStartIndex]['scope_closer']) ? $tokens[$scopeStartIndex]['scope_closer'] : 0; - - if (self::isArrowFunction($phpcsFile, $scopeStartIndex)) { - $arrowFunctionInfo = self::getArrowFunctionOpenClose($phpcsFile, $scopeStartIndex); - $scopeCloserIndex = $arrowFunctionInfo ? $arrowFunctionInfo['scope_closer'] : $scopeCloserIndex; - } - if ($scopeStartIndex === 0) { $scopeCloserIndex = self::getLastNonEmptyTokenIndexInFile($phpcsFile); } From 75768dae6b2ebf2474f2e56f94bc9be6329547f3 Mon Sep 17 00:00:00 2001 From: Payton Swick Date: Sun, 25 Jan 2026 13:22:57 -0500 Subject: [PATCH 08/11] Simplify getListAssignments using Lists::getAssignments --- VariableAnalysis/Lib/Helpers.php | 141 ++++++------------------------- 1 file changed, 27 insertions(+), 114 deletions(-) diff --git a/VariableAnalysis/Lib/Helpers.php b/VariableAnalysis/Lib/Helpers.php index 8562437..4d535e6 100644 --- a/VariableAnalysis/Lib/Helpers.php +++ b/VariableAnalysis/Lib/Helpers.php @@ -11,6 +11,7 @@ use VariableAnalysis\Lib\VariableInfo; use PHP_CodeSniffer\Util\Tokens; use PHPCSUtils\Utils\Context; +use PHPCSUtils\Utils\Lists; use PHPCSUtils\Utils\Parentheses; class Helpers @@ -733,64 +734,6 @@ public static function getArrowFunctionOpenClose(File $phpcsFile, $stackPtr) ]; } - /** - * Determine if a token is a list opener for list assignment/destructuring. - * - * The index provided can be either the opening square brace of a short list - * assignment like the first character of `[$a] = $b;` or the `list` token of - * an expression like `list($a) = $b;` or the opening parenthesis of that - * expression. - * - * @param File $phpcsFile - * @param int $listOpenerIndex - * - * @return bool - */ - private static function isListAssignment(File $phpcsFile, $listOpenerIndex) - { - $tokens = $phpcsFile->getTokens(); - // Match `[$a] = $b;` except for when the previous token is a parenthesis. - if ($tokens[$listOpenerIndex]['code'] === T_OPEN_SHORT_ARRAY) { - return true; - } - // Match `list($a) = $b;` - if ($tokens[$listOpenerIndex]['code'] === T_LIST) { - return true; - } - - // If $listOpenerIndex is the open parenthesis of `list($a) = $b;`, then - // match that too. - if ($tokens[$listOpenerIndex]['code'] === T_OPEN_PARENTHESIS) { - $previousTokenPtr = $phpcsFile->findPrevious(Tokens::$emptyTokens, $listOpenerIndex - 1, null, true); - if ( - isset($tokens[$previousTokenPtr]) - && $tokens[$previousTokenPtr]['code'] === T_LIST - ) { - return true; - } - return true; - } - - // If the list opener token is a square bracket that is preceeded by a - // close parenthesis that has an owner which is a scope opener, then this - // is a list assignment and not an array access. - // - // Match `if (true) [$a] = $b;` - if ($tokens[$listOpenerIndex]['code'] === T_OPEN_SQUARE_BRACKET) { - $previousTokenPtr = $phpcsFile->findPrevious(Tokens::$emptyTokens, $listOpenerIndex - 1, null, true); - if ( - isset($tokens[$previousTokenPtr]) - && $tokens[$previousTokenPtr]['code'] === T_CLOSE_PARENTHESIS - && isset($tokens[$previousTokenPtr]['parenthesis_owner']) - && isset(Tokens::$scopeOpeners[$tokens[$tokens[$previousTokenPtr]['parenthesis_owner']]['code']]) - ) { - return true; - } - } - - return false; - } - /** * Return a list of indices for variables assigned within a list assignment. * @@ -806,74 +749,44 @@ private static function isListAssignment(File $phpcsFile, $listOpenerIndex) */ public static function getListAssignments(File $phpcsFile, $listOpenerIndex) { - $tokens = $phpcsFile->getTokens(); - self::debug('getListAssignments', $listOpenerIndex, $tokens[$listOpenerIndex]); + self::debug('getListAssignments', $listOpenerIndex, $phpcsFile->getTokens()[$listOpenerIndex]); - // First find the end of the list - $closePtr = null; - if (isset($tokens[$listOpenerIndex]['parenthesis_closer'])) { - $closePtr = $tokens[$listOpenerIndex]['parenthesis_closer']; - } - if (isset($tokens[$listOpenerIndex]['bracket_closer'])) { - $closePtr = $tokens[$listOpenerIndex]['bracket_closer']; - } - if (! $closePtr) { + // Use PHPCSUtils to get detailed assignment information + try { + $assignments = \PHPCSUtils\Utils\Lists::getAssignments($phpcsFile, $listOpenerIndex); + } catch (\PHPCSUtils\Exceptions\UnexpectedTokenType $e) { + // Not a list token return null; } - // Find the assignment (equals sign) which, if this is a list assignment, should be the next non-space token - $assignPtr = $phpcsFile->findNext(Tokens::$emptyTokens, $closePtr + 1, null, true); - - // If the next token isn't an assignment, check for nested brackets because we might be a nested assignment - if (! is_int($assignPtr) || $tokens[$assignPtr]['code'] !== T_EQUAL) { - // Collect the enclosing list open/close tokens ($parents is an assoc array keyed by opener index and the value is the closer index) - $parents = isset($tokens[$listOpenerIndex]['nested_parenthesis']) ? $tokens[$listOpenerIndex]['nested_parenthesis'] : []; - // There's no record of nested brackets for short lists; we'll have to find the parent ourselves - if (empty($parents)) { - $parentSquareBracketPtr = self::findContainingOpeningSquareBracket($phpcsFile, $listOpenerIndex); - if (is_int($parentSquareBracketPtr)) { - // Make sure that the parent is really a parent by checking that its - // closing index is outside of the current bracket's closing index. - $parentSquareBracketToken = $tokens[$parentSquareBracketPtr]; - $parentSquareBracketClosePtr = $parentSquareBracketToken['bracket_closer']; - if ($parentSquareBracketClosePtr && $parentSquareBracketClosePtr > $closePtr) { - self::debug("found enclosing bracket for {$listOpenerIndex}: {$parentSquareBracketPtr}"); - // Collect the opening index, but we don't actually need the closing paren index so just make that 0 - $parents = [$parentSquareBracketPtr => 0]; - } - } - } - // If we have no parents, this is not a nested assignment and therefore is not an assignment - if (empty($parents)) { - return null; - } - - // Recursively check to see if the parent is a list assignment (we only need to check one level due to the recursion) - $isNestedAssignment = null; - $parentListOpener = array_keys(array_reverse($parents, true))[0]; - $isNestedAssignment = self::getListAssignments($phpcsFile, $parentListOpener); - if ($isNestedAssignment === null) { - return null; - } + if (empty($assignments)) { + return null; } + // Extract just the variable token positions for backward compatibility $variablePtrs = []; + foreach ($assignments as $assignment) { + // Skip empty list items like in: list($a, , $b) + if ($assignment['is_empty']) { + continue; + } - $currentPtr = $listOpenerIndex; - $variablePtr = 0; - while ($currentPtr < $closePtr && is_int($variablePtr)) { - $variablePtr = $phpcsFile->findNext([T_VARIABLE], $currentPtr + 1, $closePtr); - if (is_int($variablePtr)) { - $variablePtrs[] = $variablePtr; + // For nested lists, recursively get the assignments + if ($assignment['is_nested_list'] && $assignment['assignment_token'] !== false) { + $nestedVars = self::getListAssignments($phpcsFile, $assignment['assignment_token']); + if (is_array($nestedVars)) { + $variablePtrs = array_merge($variablePtrs, $nestedVars); + } + continue; } - ++$currentPtr; - } - if (! self::isListAssignment($phpcsFile, $listOpenerIndex)) { - return null; + // For regular variables, use the assignment_token which points to the T_VARIABLE + if ($assignment['assignment_token'] !== false && $assignment['variable'] !== false) { + $variablePtrs[] = $assignment['assignment_token']; + } } - return $variablePtrs; + return empty($variablePtrs) ? null : $variablePtrs; } /** From c6378ff6e476b860fb13b106d62f1fdfae21c652 Mon Sep 17 00:00:00 2001 From: Payton Swick Date: Sun, 25 Jan 2026 19:57:06 -0500 Subject: [PATCH 09/11] Add Override attribute to Sniff --- VariableAnalysis/Sniffs/CodeAnalysis/VariableAnalysisSniff.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/VariableAnalysis/Sniffs/CodeAnalysis/VariableAnalysisSniff.php b/VariableAnalysis/Sniffs/CodeAnalysis/VariableAnalysisSniff.php index b464c26..c0419d8 100644 --- a/VariableAnalysis/Sniffs/CodeAnalysis/VariableAnalysisSniff.php +++ b/VariableAnalysis/Sniffs/CodeAnalysis/VariableAnalysisSniff.php @@ -170,6 +170,7 @@ public function __construct() * * @return (int|string)[] */ + #[\Override] public function register() { $types = [ @@ -240,6 +241,7 @@ private function getPassByReferenceFunctions() * * @return void */ + #[\Override] public function process(File $phpcsFile, $stackPtr) { $tokens = $phpcsFile->getTokens(); From ddec7e17951bc7c512d462454ccf234f4ca29e7a Mon Sep 17 00:00:00 2001 From: Payton Swick Date: Sun, 25 Jan 2026 19:57:18 -0500 Subject: [PATCH 10/11] Remove unnecessary psalm disables --- psalm-baseline.xml | 7 ------- 1 file changed, 7 deletions(-) diff --git a/psalm-baseline.xml b/psalm-baseline.xml index 3bf1ba8..714d614 100644 --- a/psalm-baseline.xml +++ b/psalm-baseline.xml @@ -28,9 +28,6 @@ - - - @@ -38,10 +35,6 @@ - - - - From 5adc4352c2d980bcf8653519755db606111baadc Mon Sep 17 00:00:00 2001 From: Payton Swick Date: Sun, 25 Jan 2026 20:03:41 -0500 Subject: [PATCH 11/11] Update README for min phpcs version --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 0eb6e07..7fab196 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ Plugin for PHP_CodeSniffer static analysis tool that adds analysis of problemati ### Requirements -VariableAnalysis requires PHP 5.4 or higher and [PHP CodeSniffer](https://github.com/PHPCSStandards/PHP_CodeSniffer) version 3.5.7 or higher. +VariableAnalysis requires PHP 5.4 or higher and [PHP CodeSniffer](https://github.com/PHPCSStandards/PHP_CodeSniffer) version 3.13.5 or higher. ### With PHPCS Composer Installer