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

parseVariableOrFunctionPostfixOrMemberPrimaryPrefix() private method

This method expects that the actual token represents any kind of valid php variable: simple variable, compound variable or variable variable. It will parse a function postfix or member primary expression when this variable is followed by an object operator, double colon or opening parenthesis.
Since: 0.9.6
private parseVariableOrFunctionPostfixOrMemberPrimaryPrefix ( ) : PDepend\Source\AST\ASTNode
return PDepend\Source\AST\ASTNode
    private function parseVariableOrFunctionPostfixOrMemberPrimaryPrefix()
    {
        $this->tokenStack->push();
        $variable = $this->parseCompoundVariableOrVariableVariableOrVariable();
        $variable = $this->parseOptionalIndexExpression($variable);
        $this->consumeComments();
        switch ($this->tokenizer->peek()) {
            case Tokens::T_DOUBLE_COLON:
                $result = $this->parseStaticMemberPrimaryPrefix($variable);
                break;
            case Tokens::T_OBJECT_OPERATOR:
                $result = $this->parseMemberPrimaryPrefix($variable);
                break;
            case Tokens::T_PARENTHESIS_OPEN:
                $result = $this->parseFunctionPostfix($variable);
                break;
            default:
                $result = $variable;
                break;
        }
        return $this->setNodePositionsAndReturn($result);
    }
AbstractPHPParser