Пример #1
0
 /**
  * Parses the given docblock string for annotations.
  *
  * @param string $docBlockString The docblock string to parse.
  * @param string $context The parsing context.
  * @return array Array of annotations. If no annotations are found, an empty array is returned.
  */
 public function parse($docBlockString, $context = '')
 {
     $this->context = $context;
     // Strip out some known inline tags.
     $input = str_replace(self::$strippedTags, '', $docBlockString);
     // Cut of the beginning of the input until the first '@'.
     $input = substr($input, strpos($input, '@'));
     $this->lexer->reset();
     $this->lexer->setInput(trim($input, '* /'));
     $this->lexer->moveNext();
     if ($this->lexer->isNextToken(Lexer::T_AT)) {
         return $this->Annotations();
     }
     return array();
 }