Automattic\WooCommerce\Vendor\GraphQL\Language

Parser::parseScalarTypeExtensionprivateWC 1.0

Method of the class: Parser{}

No Hooks.

Returns

null. Nothing (null).

Usage

// private - for code of main (parent) class only
$result = $this->parseScalarTypeExtension(): ScalarTypeExtensionNode;

Parser::parseScalarTypeExtension() code WC 11.0.1

private function parseScalarTypeExtension(): ScalarTypeExtensionNode
{
    $start = $this->lexer->token;
    $this->expectKeyword('extend');
    $this->expectKeyword('scalar');
    $name = $this->parseName();
    $directives = $this->parseDirectives(true);
    if (count($directives) === 0) {
        throw $this->unexpected();
    }

    return new ScalarTypeExtensionNode([
        'name' => $name,
        'directives' => $directives,
        'loc' => $this->loc($start),
    ]);
}