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

parseFormalParameters() private method

Extracts all dependencies from a callable signature.
Since: 0.9.5
private parseFormalParameters ( ) : PDepend\Source\AST\ASTFormalParameters
return PDepend\Source\AST\ASTFormalParameters
    private function parseFormalParameters()
    {
        $this->consumeComments();
        $this->tokenStack->push();
        $formalParameters = $this->builder->buildAstFormalParameters();
        $this->consumeToken(Tokens::T_PARENTHESIS_OPEN);
        $this->consumeComments();
        $tokenType = $this->tokenizer->peek();
        // Check for function without parameters
        if ($tokenType === Tokens::T_PARENTHESIS_CLOSE) {
            $this->consumeToken(Tokens::T_PARENTHESIS_CLOSE);
            return $this->setNodePositionsAndReturn($formalParameters);
        }
        while ($tokenType !== Tokenizer::T_EOF) {
            $formalParameters->addChild($this->parseFormalParameterOrTypeHintOrByReference());
            $this->consumeComments();
            $tokenType = $this->tokenizer->peek();
            // Check for following parameter
            if ($tokenType !== Tokens::T_COMMA) {
                break;
            }
            $this->consumeToken(Tokens::T_COMMA);
        }
        $this->consumeToken(Tokens::T_PARENTHESIS_CLOSE);
        return $this->setNodePositionsAndReturn($formalParameters);
    }
AbstractPHPParser