fromComment() public method

Use doctrine to parse the comment block and return the detected annotations.
public fromComment ( string $comment, Context $context = null ) : array
$comment string a T_DOC_COMMENT.
$context Context
return array Annotations
示例#1
0
 /**
  *
  * @param string $comment Contents of a comment block
  * @return AbstractAnnotation[]
  */
 protected function parseComment($comment)
 {
     $analyser = new Analyser();
     $context = Context::detect(1);
     $context->line -= 1;
     // correct generated lines: "<?php\n" and "/**\n"
     return $analyser->fromComment("<?php\n/**\n * " . implode("\n * ", explode("\n", $comment)) . "\n*/", $context);
 }