SlevomatCodingStandard\Helpers\TokenHelper::getLastTokenPointer PHP Method

getLastTokenPointer() public static method

public static getLastTokenPointer ( PHP_CodeSniffer_File $phpcsFile ) : integer
$phpcsFile PHP_CodeSniffer_File
return integer
    public static function getLastTokenPointer(PHP_CodeSniffer_File $phpcsFile)
    {
        $tokenCount = count($phpcsFile->getTokens());
        if ($tokenCount === 0) {
            throw new \SlevomatCodingStandard\Helpers\EmptyFileException($phpcsFile->getFilename());
        }
        return $tokenCount - 1;
    }