function UnusedVariableSniff::isUsedAsParameter
1 call to UnusedVariableSniff::isUsedAsParameter()
- UnusedVariableSniff::process in vendor/
slevomat/ coding-standard/ SlevomatCodingStandard/ Sniffs/ Variables/ UnusedVariableSniff.php - * @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint *
File
-
vendor/
slevomat/ coding-standard/ SlevomatCodingStandard/ Sniffs/ Variables/ UnusedVariableSniff.php, line 293
Class
Namespace
SlevomatCodingStandard\Sniffs\VariablesCode
private function isUsedAsParameter(File $phpcsFile, int $variablePointer) : bool {
$parenthesisOpenerPointer = $this->findOpenerOfNestedParentheses($phpcsFile, $variablePointer);
if ($parenthesisOpenerPointer === null) {
return false;
}
if (!ScopeHelper::isInSameScope($phpcsFile, $parenthesisOpenerPointer, $variablePointer)) {
return false;
}
return $phpcsFile->getTokens()[TokenHelper::findPreviousEffective($phpcsFile, $parenthesisOpenerPointer - 1)]['code'] === T_STRING;
}