PDepend\Source\Language\PHP\AbstractPHPParser::prepareCallable PHP Method

prepareCallable() private method

Extracts documented throws and return types and sets them to the given $callable instance.
private prepareCallable ( PDepend\Source\AST\AbstractASTCallable $callable ) : void
$callable PDepend\Source\AST\AbstractASTCallable
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));
        }
    }
AbstractPHPParser