function DocParser::ArrayEntry
Same name in this branch
- 11.1.x core/lib/Drupal/Component/Annotation/Doctrine/DocParser.php \Drupal\Component\Annotation\Doctrine\DocParser::ArrayEntry()
ArrayEntry ::= Value | KeyValuePair KeyValuePair ::= Key ("=" | ":") PlainValue | Constant Key ::= string | integer | Constant
@phpstan-return array{mixed, mixed}
Throws
ReflectionException
1 call to DocParser::ArrayEntry()
- DocParser::Arrayx in vendor/
doctrine/ annotations/ lib/ Doctrine/ Common/ Annotations/ DocParser.php - Array ::= "{" ArrayEntry {"," ArrayEntry}* [","] "}"
File
-
vendor/
doctrine/ annotations/ lib/ Doctrine/ Common/ Annotations/ DocParser.php, line 1374
Class
- DocParser
- A parser for docblock annotations.
Namespace
Doctrine\Common\AnnotationsCode
private function ArrayEntry() : array {
$peek = $this->lexer
->glimpse();
if ($peek->type === DocLexer::T_EQUALS || $peek->type === DocLexer::T_COLON) {
if ($this->lexer
->isNextToken(DocLexer::T_IDENTIFIER)) {
$key = $this->Constant();
}
else {
$this->matchAny([
DocLexer::T_INTEGER,
DocLexer::T_STRING,
]);
$key = $this->lexer->token->value;
}
$this->matchAny([
DocLexer::T_EQUALS,
DocLexer::T_COLON,
]);
return [
$key,
$this->PlainValue(),
];
}
return [
null,
$this->Value(),
];
}