function ScopeHelper::getRootPointer
1 call to ScopeHelper::getRootPointer()
- UnusedVariableSniff::process in vendor/
slevomat/ coding-standard/ SlevomatCodingStandard/ Sniffs/ Variables/ UnusedVariableSniff.php - * @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint *
File
-
vendor/
slevomat/ coding-standard/ SlevomatCodingStandard/ Helpers/ ScopeHelper.php, line 38
Class
- ScopeHelper
- @internal
Namespace
SlevomatCodingStandard\HelpersCode
public static function getRootPointer(File $phpcsFile, int $pointer) : int {
$rootPointer = TokenHelper::findNext($phpcsFile, T_OPEN_TAG, 0);
$rootPointers = array_reverse(self::getAllRootPointers($phpcsFile));
foreach ($rootPointers as $currentRootPointer) {
if ($currentRootPointer < $pointer) {
$rootPointer = $currentRootPointer;
break;
}
}
return $rootPointer;
}