private static function getUseStatementPointers(File $phpcsFile, int $openTagPointer): array
	{
		$tokens = $phpcsFile->getTokens();
		$pointer = $openTagPointer + 1;
		$pointers = [];
		while (true) {
			$typesToFind = array_merge([T_USE], TokenHelper::$typeKeywordTokenCodes);
			$pointer = TokenHelper::findNext($phpcsFile, $typesToFind, $pointer);
			if ($pointer === null) {
				break;
			}

			$token = $tokens[$pointer];
			if (in_array($token['code'], TokenHelper::$typeKeywordTokenCodes, true)) {
				$pointer = $token['scope_closer'] + 1;
				continue;
			}
			if (self::isAnonymousFunctionUse($phpcsFile, $pointer)) {
				$pointer++;
				continue;
			}
			$pointers[] = $pointer;
			$pointer++;
		}
		return $pointers;
	}
private static function getUseStatementPointers(File $phpcsFile, int $openTagPointer): array
	{
		$tokens = $phpcsFile->getTokens();
		$pointer = $openTagPointer + 1;
		$pointers = [];
		while (true) {
			$typesToFind = array_merge([T_USE], TokenHelper::$typeKeywordTokenCodes);
			$pointer = TokenHelper::findNext($phpcsFile, $typesToFind, $pointer);
			if ($pointer === null) {
				break;
			}

			$token = $tokens[$pointer];
			if (in_array($token['code'], TokenHelper::$typeKeywordTokenCodes, true)) {
				$pointer = $token['scope_closer'] + 1;
				continue;
			}
			if (self::isAnonymousFunctionUse($phpcsFile, $pointer)) {
				$pointer++;
				continue;
			}
			$pointers[] = $pointer;
			$pointer++;
		}
		return $pointers;
	}
private static function getUseStatementPointers ( File $ phpcsFile , int $ openTagPointer ) : array { $ tokens = $ phpcsFile -> getTokens ( ) ; $ pointer = $ openTagPointer + 1 ; $ pointers = [ ] ; while ( true ) { $ typesToFind = array_merge ( [ T_USE ] , TokenHelper :: $ typeKeywordTokenCodes ) ; $ pointer = TokenHelper :: findNext ( $ phpcsFile , $ typesToFind , $ pointer ) ; if ( $ pointer === null ) { break ; } $ token = $ tokens [ $ pointer ] ; if ( in_array ( $ token [ 'code' ] , TokenHelper :: $ typeKeywordTokenCodes , true ) ) { $ pointer = $ token [ 'scope_closer' ] + 1 ; continue ; } if ( self :: isAnonymousFunctionUse ( $ phpcsFile , $ pointer ) ) { $ pointer ++ ; continue ; } $ pointers [ ] = $ pointer ; $ pointer ++ ; } return $ pointers ; }
Searches for all use statements in a file, skips bodies of classes and traits.

@param \PHP_CodeSniffer\Files\File $phpcsFile
@param int $openTagPointer
@return int[]
Searches for all use statements in a file skips bodies of classes and traits .