function ConstExprParser::parseDoctrineString
* This method is supposed to be called with TokenIterator after reading TOKEN_DOUBLE_QUOTED_STRING and shifting * to the next token.
1 call to ConstExprParser::parseDoctrineString()
- ConstExprParser::parse in vendor/
phpstan/ phpdoc-parser/ src/ Parser/ ConstExprParser.php
File
-
vendor/
phpstan/ phpdoc-parser/ src/ Parser/ ConstExprParser.php, line 276
Class
Namespace
PHPStan\PhpDocParser\ParserCode
public function parseDoctrineString(string $text, TokenIterator $tokens) : Ast\ConstExpr\DoctrineConstExprStringNode {
// Because of how Lexer works, a valid Doctrine string
// can consist of a sequence of TOKEN_DOUBLE_QUOTED_STRING and TOKEN_DOCTRINE_ANNOTATION_STRING
while ($tokens->isCurrentTokenType(Lexer::TOKEN_DOUBLE_QUOTED_STRING, Lexer::TOKEN_DOCTRINE_ANNOTATION_STRING)) {
$text .= $tokens->currentTokenValue();
$tokens->next();
}
return new Ast\ConstExpr\DoctrineConstExprStringNode(Ast\ConstExpr\DoctrineConstExprStringNode::unescape($text));
}