Automattic\WooCommerce\Vendor\GraphQL\Language

Parser::parseArrayprivateWC 1.0

Method of the class: Parser{}

No Hooks.

Returns

null. Nothing (null).

Usage

// private - for code of main (parent) class only
$result = $this->parseArray( $isConst ): ListValueNode;
$isConst(true|false) (required)
.

Parser::parseArray() code WC 11.1.1

private function parseArray(bool $isConst): ListValueNode
{
    $start = $this->lexer->token;
    $parseFn = $isConst
        ? fn (): ValueNode => $this->parseConstValue()
        : fn (): ValueNode => $this->parseVariableValue();

    return new ListValueNode([
        'values' => $this->any(Token::BRACKET_L, $parseFn, Token::BRACKET_R),
        'loc' => $this->loc($start),
    ]);
}