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

parseDeclareList() private method

This method parses a list of declare values. A declare list value always consists of a string token and a static scalar.
Since: 0.10.0
private parseDeclareList ( PDepend\Source\AST\ASTDeclareStatement $stmt ) : PDepend\Source\AST\ASTDeclareStatement
$stmt PDepend\Source\AST\ASTDeclareStatement The declare statement that is the owner of this list.
return PDepend\Source\AST\ASTDeclareStatement
    private function parseDeclareList(ASTDeclareStatement $stmt)
    {
        $this->consumeComments();
        $this->consumeToken(Tokens::T_PARENTHESIS_OPEN);
        while (true) {
            $this->consumeComments();
            $name = $this->consumeToken(Tokens::T_STRING)->image;
            $this->consumeComments();
            $this->consumeToken(Tokens::T_EQUAL);
            $this->consumeComments();
            $value = $this->parseStaticValue();
            $stmt->addValue($name, $value);
            $this->consumeComments();
            if ($this->tokenizer->peek() === Tokens::T_COMMA) {
                $this->consumeToken(Tokens::T_COMMA);
                continue;
            }
            break;
        }
        $this->consumeToken(Tokens::T_PARENTHESIS_CLOSE);
        return $stmt;
    }
AbstractPHPParser