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

parseStaticVariableDeclaration() private method

function foo() { First declaration static $foo; Second declaration static $bar = array(); Third declaration static $baz = array(), $foobar = null, $barbaz; }
Since: 0.9.6
private parseStaticVariableDeclaration ( PDepend\Source\Tokenizer\Token $token ) : PDepend\Source\AST\ASTStaticVariableDeclaration
$token PDepend\Source\Tokenizer\Token Token with the "static" keyword.
return PDepend\Source\AST\ASTStaticVariableDeclaration
    private function parseStaticVariableDeclaration(Token $token)
    {
        $staticDeclaration = $this->builder->buildAstStaticVariableDeclaration($token->image);
        // Strip optional comments
        $this->consumeComments();
        // Fetch next token type
        $tokenType = $this->tokenizer->peek();
        while ($tokenType !== Tokenizer::T_EOF) {
            $staticDeclaration->addChild($this->parseVariableDeclarator());
            $this->consumeComments();
            // Semicolon terminates static declaration
            $tokenType = $this->tokenizer->peek();
            if ($tokenType === Tokens::T_SEMICOLON) {
                break;
            }
            // We are here, so there must be a next declarator
            $this->consumeToken(Tokens::T_COMMA);
        }
        return $staticDeclaration;
    }
AbstractPHPParser