Automattic\WooCommerce\Vendor\GraphQL\Type\Definition
FloatType::parseLiteral
Method of the class: FloatType{}
No Hooks.
Returns
null. Nothing (null).
Usage
$FloatType = new FloatType(); $FloatType->parseLiteral( $valueNode, ?array $variables );
- $valueNode(Node) (required)
- .
- ?array $variables
- .
Default:null
FloatType::parseLiteral() FloatType::parseLiteral code WC 10.9.1
public function parseLiteral(Node $valueNode, ?array $variables = null)
{
if ($valueNode instanceof FloatValueNode || $valueNode instanceof IntValueNode) {
return (float) $valueNode->value;
}
$notFloat = Printer::doPrint($valueNode);
throw new Error("Float cannot represent non numeric value: {$notFloat}", $valueNode);
}