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
Namespace
PhpParserCode
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);
}