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;