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

Breadcrumb

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

function ParserAbstract::createCommentFromToken

1 call to ParserAbstract::createCommentFromToken()
ParserAbstract::getCommentBeforeToken in vendor/nikic/php-parser/lib/PhpParser/ParserAbstract.php
Get last comment before the given token position, if any

File

vendor/nikic/php-parser/lib/PhpParser/ParserAbstract.php, line 893

Class

ParserAbstract

Namespace

PhpParser

Code

protected function createCommentFromToken(Token $token, int $tokenPos) : Comment {
    assert($token->id === \T_COMMENT || $token->id == \T_DOC_COMMENT);
    return \T_DOC_COMMENT === $token->id ? new Comment\Doc($token->text, $token->line, $token->pos, $tokenPos, $token->getEndLine(), $token->getEndPos() - 1, $tokenPos) : new Comment($token->text, $token->line, $token->pos, $tokenPos, $token->getEndLine(), $token->getEndPos() - 1, $tokenPos);
}

API Navigation

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