You are here

public function DocParser::parse in Service Container 7.2

Same name and namespace in other branches
  1. 7 modules/providers/service_container_annotation_discovery/lib/Doctrine/annotations/lib/Doctrine/Common/Annotations/DocParser.php \Doctrine\Common\Annotations\DocParser::parse()

Parses the given docblock string for annotations.

Parameters

string $input The docblock string to parse.:

string $context The parsing context.:

Return value

array Array of annotations. If no annotations are found, an empty array is returned.

File

modules/providers/service_container_annotation_discovery/lib/Doctrine/annotations/lib/Doctrine/Common/Annotations/DocParser.php, line 322

Class

DocParser
A parser for docblock annotations.

Namespace

Doctrine\Common\Annotations

Code

public function parse($input, $context = '') {
  $pos = $this
    ->findInitialTokenPosition($input);
  if ($pos === null) {
    return array();
  }
  $this->context = $context;
  $this->lexer
    ->setInput(trim(substr($input, $pos), '* /'));
  $this->lexer
    ->moveNext();
  return $this
    ->Annotations();
}