public function 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

drupal/core/vendor/doctrine/common/lib/Doctrine/Common/Annotations/DocParser.php, line 282

Class

DocParser
A parser for docblock annotations.

Namespace

Doctrine\Common\Annotations

Code

public function parse($input, $context = '') {
  if (false === ($pos = strpos($input, '@'))) {
    return array();
  }

  // also parse whatever character is before the @
  if ($pos > 0) {
    $pos -= 1;
  }
  $this->context = $context;
  $this->lexer
    ->setInput(trim(substr($input, $pos), '* /'));
  $this->lexer
    ->moveNext();
  return $this
    ->Annotations();
}