Automattic\WooCommerce\Vendor\GraphQL\Type\Definition
IntType::parseLiteral
Method of the class: IntType{}
No Hooks.
Returns
null. Nothing (null).
Usage
$IntType = new IntType(); $IntType->parseLiteral( $valueNode, ?array $variables ): int;
- $valueNode(Node) (required)
- .
- ?array $variables
- .
Default:null
IntType::parseLiteral() IntType::parseLiteral code WC 10.9.1
public function parseLiteral(Node $valueNode, ?array $variables = null): int
{
if ($valueNode instanceof IntValueNode) {
$val = (int) $valueNode->value;
if ($valueNode->value === (string) $val && $val >= self::MIN_INT && $val <= self::MAX_INT) {
return $val;
}
}
$notInt = Printer::doPrint($valueNode);
throw new Error("Int cannot represent non-integer value: {$notInt}", $valueNode);
}