Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. TokenHelper.php

function TokenHelper::getLastTokenPointer

1 call to TokenHelper::getLastTokenPointer()
TokenHelper::getContent in vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/TokenHelper.php

File

vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/TokenHelper.php, line 467

Class

TokenHelper
@internal

Namespace

SlevomatCodingStandard\Helpers

Code

public static function getLastTokenPointer(File $phpcsFile) : int {
    $tokenCount = count($phpcsFile->getTokens());
    if ($tokenCount === 0) {
        throw new EmptyFileException($phpcsFile->getFilename());
    }
    return $tokenCount - 1;
}
RSS feed
Powered by Drupal