From b1b9871f2231d771f417d7a963bed449b62aee6c Mon Sep 17 00:00:00 2001 From: Payton Swick Date: Sun, 1 Dec 2024 14:33:12 -0500 Subject: [PATCH] Fix linting errors --- VariableAnalysis/Lib/Helpers.php | 3 ++- VariableAnalysis/Sniffs/CodeAnalysis/VariableAnalysisSniff.php | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/VariableAnalysis/Lib/Helpers.php b/VariableAnalysis/Lib/Helpers.php index d793e67..73164e1 100644 --- a/VariableAnalysis/Lib/Helpers.php +++ b/VariableAnalysis/Lib/Helpers.php @@ -4,6 +4,7 @@ use PHP_CodeSniffer\Files\File; use VariableAnalysis\Lib\ScopeInfo; +use VariableAnalysis\Lib\Constants; use VariableAnalysis\Lib\ForLoopInfo; use VariableAnalysis\Lib\EnumInfo; use VariableAnalysis\Lib\ScopeType; @@ -472,7 +473,7 @@ public static function getVariablesInsideCompact(File $phpcsFile, $stackPtr, $ar $argumentFirstToken = $tokens[$argumentPtrs[0]]; if ($argumentFirstToken['code'] === T_ARRAY) { // It's an array argument, recurse. - $arrayArguments = Helpers::findFunctionCallArguments($phpcsFile, $argumentPtrs[0]); + $arrayArguments = self::findFunctionCallArguments($phpcsFile, $argumentPtrs[0]); $variablePositionsAndNames = array_merge($variablePositionsAndNames, self::getVariablesInsideCompact($phpcsFile, $stackPtr, $arrayArguments)); continue; } diff --git a/VariableAnalysis/Sniffs/CodeAnalysis/VariableAnalysisSniff.php b/VariableAnalysis/Sniffs/CodeAnalysis/VariableAnalysisSniff.php index c347327..5eaea94 100644 --- a/VariableAnalysis/Sniffs/CodeAnalysis/VariableAnalysisSniff.php +++ b/VariableAnalysis/Sniffs/CodeAnalysis/VariableAnalysisSniff.php @@ -1882,7 +1882,7 @@ protected function processCompact(File $phpcsFile, $stackPtr) Helpers::debug("processCompact at {$stackPtr}"); $arguments = Helpers::findFunctionCallArguments($phpcsFile, $stackPtr); $variables = Helpers::getVariablesInsideCompact($phpcsFile, $stackPtr, $arguments); - foreach ( $variables as $variable ) { + foreach ($variables as $variable) { $currScope = Helpers::findVariableScope($phpcsFile, $stackPtr, $variable->name); if ($currScope === null) { continue;