function DocParser::parse
Same name in this branch
- 11.1.x core/lib/Drupal/Component/Annotation/Doctrine/DocParser.php \Drupal\Component\Annotation\Doctrine\DocParser::parse()
Parses the given docblock string for annotations.
@phpstan-return list<object> Array of annotations. If no annotations are found, an empty array is returned.
Throws
ReflectionException
File
-
vendor/
doctrine/ annotations/ lib/ Doctrine/ Common/ Annotations/ DocParser.php, line 358
Class
- DocParser
- A parser for docblock annotations.
Namespace
Doctrine\Common\AnnotationsCode
public function parse(string $input, string $context = '') {
$pos = $this->findInitialTokenPosition($input);
if ($pos === null) {
return [];
}
$this->context = $context;
$this->lexer
->setInput(trim(substr($input, $pos), '* /'));
$this->lexer
->moveNext();
return $this->Annotations();
}