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

Breadcrumb

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

function ParsedDocComment::getNodeStartPointer

File

vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/ParsedDocComment.php, line 62

Class

ParsedDocComment
@internal

Namespace

SlevomatCodingStandard\Helpers

Code

public function getNodeStartPointer(File $phpcsFile, Node $node) : int {
    $tokens = $phpcsFile->getTokens();
    $tagStartLine = $tokens[$this->openPointer]['line'] + $node->getAttribute('startLine') - 1;
    $searchPointer = $this->openPointer + 1;
    for ($i = $this->openPointer + 1; $i < $this->closePointer; $i++) {
        if ($tagStartLine === $tokens[$i]['line']) {
            $searchPointer = $i;
            break;
        }
    }
    return TokenHelper::findNext($phpcsFile, array_merge(TokenHelper::$annotationTokenCodes, [
        T_DOC_COMMENT_STRING,
    ]), $searchPointer);
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal