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

parseMethodDeclaration() private method

This method parses a method declaration.
Since: 0.9.5
private parseMethodDeclaration ( ) : PDepend\Source\AST\ASTMethod
return PDepend\Source\AST\ASTMethod
    private function parseMethodDeclaration()
    {
        // Read function keyword
        $this->consumeToken(Tokens::T_FUNCTION);
        $this->consumeComments();
        $returnsReference = $this->parseOptionalByReference();
        $methodName = $this->parseMethodName();
        $method = $this->builder->buildMethod($methodName);
        $method->setComment($this->docComment);
        $method->setCompilationUnit($this->compilationUnit);
        $this->classOrInterface->addMethod($method);
        $this->parseCallableDeclaration($method);
        $this->prepareCallable($method);
        if ($returnsReference === true) {
            $method->setReturnsReference();
        }
        return $method;
    }
AbstractPHPParser