function Helpers::areFollowingArgumentsUsed
*
Parameters
VariableInfo $varInfo: * @param ScopeInfo $scopeInfo * * @return bool
1 call to Helpers::areFollowingArgumentsUsed()
- VariableAnalysisSniff::processScopeCloseForVariable in vendor/
sirbrillig/ phpcs-variable-analysis/ VariableAnalysis/ Sniffs/ CodeAnalysis/ VariableAnalysisSniff.php - * Warn about an unused variable if it has not been used within a scope. * *
File
-
vendor/
sirbrillig/ phpcs-variable-analysis/ VariableAnalysis/ Lib/ Helpers.php, line 1221
Class
Namespace
VariableAnalysis\LibCode
public static function areFollowingArgumentsUsed(VariableInfo $varInfo, ScopeInfo $scopeInfo) {
$foundVarPosition = false;
foreach ($scopeInfo->variables as $variable) {
if ($variable === $varInfo) {
$foundVarPosition = true;
continue;
}
if (!$foundVarPosition) {
continue;
}
if ($variable->scopeType !== ScopeType::PARAM) {
continue;
}
if ($variable->firstRead) {
return true;
}
}
return false;
}