PDepend\Source\Language\PHP\AbstractPHPParser::parseCompoundVariableOrVariableVariable PHP Метод

parseCompoundVariableOrVariableVariable() приватный Метод

This method implements a decision point between compound-variables and variable-variable. It expects that the next token in the token-stream is of type T_DOLLAR and removes it from the stream. Then this method peeks the next available token when it is of type T_CURLY_BRACE_OPEN this is compound variable, otherwise it can be a variable-variable or a compound-variable.
С версии: 0.9.6
private parseCompoundVariableOrVariableVariable ( ) : PDepend\Source\AST\ASTNode
Результат PDepend\Source\AST\ASTNode
    private function parseCompoundVariableOrVariableVariable()
    {
        $this->tokenStack->push();
        // Read the dollar token
        $token = $this->consumeToken(Tokens::T_DOLLAR);
        $this->consumeComments();
        // Get next token type
        $tokenType = $this->tokenizer->peek();
        // T_DOLLAR|T_VARIABLE === Variable variable,
        // T_CURLY_BRACE_OPEN === Compound variable
        switch ($tokenType) {
            case Tokens::T_DOLLAR:
            case Tokens::T_VARIABLE:
                $variable = $this->builder->buildAstVariableVariable($token->image);
                $variable->addChild($this->parseCompoundVariableOrVariableVariableOrVariable());
                break;
            default:
                $variable = $this->parseCompoundVariable($token);
                break;
        }
        return $this->setNodePositionsAndReturn($variable);
    }
AbstractPHPParser