function DocParser::Values
Same name in this branch
- 11.1.x core/lib/Drupal/Component/Annotation/Doctrine/DocParser.php \Drupal\Component\Annotation\Doctrine\DocParser::Values()
Values ::= Array | Value {"," Value}* [","]
@psalm-return Arguments
Throws
ReflectionException
1 call to DocParser::Values()
- DocParser::MethodCall in vendor/
doctrine/ annotations/ lib/ Doctrine/ Common/ Annotations/ DocParser.php - MethodCall ::= ["(" [Values] ")"]
File
-
vendor/
doctrine/ annotations/ lib/ Doctrine/ Common/ Annotations/ DocParser.php, line 1063
Class
- DocParser
- A parser for docblock annotations.
Namespace
Doctrine\Common\AnnotationsCode
private function Values() : array {
$values = [
$this->Value(),
];
while ($this->lexer
->isNextToken(DocLexer::T_COMMA)) {
$this->match(DocLexer::T_COMMA);
if ($this->lexer
->isNextToken(DocLexer::T_CLOSE_PARENTHESIS)) {
break;
}
$token = $this->lexer->lookahead;
$value = $this->Value();
$values[] = $value;
}
$namedArguments = [];
$positionalArguments = [];
foreach ($values as $k => $value) {
if (is_object($value) && $value instanceof stdClass) {
$namedArguments[$value->name] = $value->value;
}
else {
$positionalArguments[$k] = $value;
}
}
return [
'named_arguments' => $namedArguments,
'positional_arguments' => $positionalArguments,
];
}