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

parseStaticVariableDeclarationOrMemberPrimaryPrefix() private method

Static variable: function foo() { ------------------------------ static $foo, $bar, $baz = null; ------------------------------ } Static method invocation: class Foo { public function baz() { ---------------- static::foobar(); ---------------- } public function foobar() } } class Bar extends Foo { public function foobar() } } Static closure declaration: $closure = static function($x, $y) { return ($x * $y); };
Since: 0.9.6
private parseStaticVariableDeclarationOrMemberPrimaryPrefix ( ) : PDepend\Source\AST\ASTConstant
return PDepend\Source\AST\ASTConstant
    private function parseStaticVariableDeclarationOrMemberPrimaryPrefix()
    {
        $this->tokenStack->push();
        // Consume static token and strip optional comments
        $token = $this->consumeToken(Tokens::T_STATIC);
        $this->consumeComments();
        // Fetch next token type
        $tokenType = $this->tokenizer->peek();
        if ($tokenType === Tokens::T_PARENTHESIS_OPEN || $tokenType === Tokens::T_DOUBLE_COLON) {
            $static = $this->parseStaticReference($token);
            $prefix = $this->parseStaticMemberPrimaryPrefix($static);
            return $this->setNodePositionsAndReturn($prefix);
        } elseif ($tokenType === Tokens::T_FUNCTION) {
            $closure = $this->parseClosureDeclaration();
            $closure->setStatic(true);
            return $this->setNodePositionsAndReturn($closure);
        }
        $declaration = $this->parseStaticVariableDeclaration($token);
        return $this->setNodePositionsAndReturn($declaration);
    }
AbstractPHPParser