示例#1
0
 /**
  * Extracts documented <b>throws</b> and <b>return</b> types and sets them
  * to the given <b>$callable</b> instance.
  *
  * @param  \PDepend\Source\AST\AbstractASTCallable $callable
  * @return void
  */
 private function prepareCallable(AbstractASTCallable $callable)
 {
     // Skip, if ignore annotations is set
     if ($this->ignoreAnnotations === true) {
         return;
     }
     // Get all @throws Types
     $throws = $this->parseThrowsAnnotations($callable->getComment());
     foreach ($throws as $qualifiedName) {
         $callable->addExceptionClassReference($this->builder->buildAstClassOrInterfaceReference($qualifiedName));
     }
     // Stop here if return class already exists.
     if ($callable->hasReturnClass()) {
         return;
     }
     // Get return annotation
     $qualifiedName = $this->parseReturnAnnotation($callable->getComment());
     if ($qualifiedName !== null) {
         $callable->setReturnClassReference($this->builder->buildAstClassOrInterfaceReference($qualifiedName));
     }
 }