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

Breadcrumb

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

function CommentHelper::getMultilineCommentEndPointer

1 call to CommentHelper::getMultilineCommentEndPointer()
UseSpacingSniff::checkLinesAfterLastUse in vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Namespaces/UseSpacingSniff.php

File

vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/CommentHelper.php, line 81

Class

CommentHelper
@internal

Namespace

SlevomatCodingStandard\Helpers

Code

public static function getMultilineCommentEndPointer(File $phpcsFile, int $commentStartPointer) : int {
    $tokens = $phpcsFile->getTokens();
    $commentEndPointer = $commentStartPointer;
    do {
        $commentAfter = TokenHelper::findNext($phpcsFile, TokenHelper::$inlineCommentTokenCodes, $commentEndPointer + 1);
        if ($commentAfter === null) {
            break;
        }
        if ($tokens[$commentAfter]['line'] - 1 !== $tokens[$commentEndPointer]['line']) {
            break;
        }
        
        /** @var int $commentEndPointer */
        $commentEndPointer = $commentAfter;
    } while (true);
    return $commentEndPointer;
}
RSS feed
Powered by Drupal