function UnusedVariableSniff::findNestedParenthesisWithOwner
2 calls to UnusedVariableSniff::findNestedParenthesisWithOwner()
- UnusedVariableSniff::isUsedInLoopCycle in vendor/
slevomat/ coding-standard/ SlevomatCodingStandard/ Sniffs/ Variables/ UnusedVariableSniff.php - UnusedVariableSniff::isValueInForeachAndErrorIsIgnored in vendor/
slevomat/ coding-standard/ SlevomatCodingStandard/ Sniffs/ Variables/ UnusedVariableSniff.php
File
-
vendor/
slevomat/ coding-standard/ SlevomatCodingStandard/ Sniffs/ Variables/ UnusedVariableSniff.php, line 666
Class
Namespace
SlevomatCodingStandard\Sniffs\VariablesCode
private function findNestedParenthesisWithOwner(File $phpcsFile, int $pointer) : ?int {
$tokens = $phpcsFile->getTokens();
if (!array_key_exists('nested_parenthesis', $tokens[$pointer])) {
return null;
}
foreach (array_reverse(array_keys($tokens[$pointer]['nested_parenthesis'])) as $nestedParenthesisOpener) {
if (array_key_exists('parenthesis_owner', $tokens[$nestedParenthesisOpener])) {
return $tokens[$nestedParenthesisOpener]['parenthesis_owner'];
}
}
return null;
}