示例#1
0
 /**
  * Dispatch annotations found in phpDoc with context given in second argument.
  *
  * @param string     $phpDoc     phpDoc
  * @param mixed      $context    context
  */
 private function processDocComment($phpDoc, $context = null)
 {
     $annotations = $this->docParser->parse($phpDoc);
     foreach ($annotations as $annotation) {
         $this->collection->dispatch(Events::TOKEN_PHP_ANNOTATION, new Context\PHP\Annotation($annotation, $context), $this->result);
     }
 }
示例#2
0
 /**
  * @param array $files files
  *
  * @return Result
  */
 private function parse(array $files)
 {
     $result = new Result();
     $this->processors->dispatch(Events::SCAN_START, null, $result);
     foreach ($files as $file) {
         $this->processors->dispatch(Events::SCAN_FILE_START, new FileContext($file), $result);
         $this->processors->dispatch(Events::FILE, new FileContext($file), $result);
         $this->processors->dispatch(Events::SCAN_FILE_END, new FileContext($file), $result);
     }
     $this->processors->dispatch(Events::SCAN_END, null, $result);
     return $result;
 }