Skip to content

Commit 6b6fdaa

Browse files
committed
Comment
1 parent 5745775 commit 6b6fdaa

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/Parser/ConstExprParser.php

+6
Original file line numberDiff line numberDiff line change
@@ -269,10 +269,16 @@ private function parseArray(TokenIterator $tokens, int $endToken, int $startInde
269269
}
270270

271271

272+
/**
273+
* This method is supposed to be called with TokenIterator after reading TOKEN_DOUBLE_QUOTED_STRING and shifting
274+
* to the next token.
275+
*/
272276
public function parseDoctrineString(string $value, TokenIterator $tokens): Ast\ConstExpr\DoctrineConstExprStringNode
273277
{
274278
$text = $value;
275279

280+
// Because of how Lexer works, a valid Doctrine string
281+
// can consist of a sequence of TOKEN_DOUBLE_QUOTED_STRING and TOKEN_DOCTRINE_ANNOTATION_STRING
276282
while ($tokens->isCurrentTokenType(Lexer::TOKEN_DOUBLE_QUOTED_STRING, Lexer::TOKEN_DOCTRINE_ANNOTATION_STRING)) {
277283
$text .= $tokens->currentTokenValue();
278284
$tokens->next();

0 commit comments

Comments
 (0)