Automattic\WooCommerce\Vendor\GraphQL\Validator\Rules

QuerySecurityRule::checkIfGreaterOrEqualToZeroprotectedWC 1.0

Method of the class: QuerySecurityRule{}

No Hooks.

Returns

null. Nothing (null).

Usage

// protected - for code of main (parent) or child class
$result = $this->checkIfGreaterOrEqualToZero( $name, $value ): void;
$name(string) (required)
.
$value(int) (required)
.

QuerySecurityRule::checkIfGreaterOrEqualToZero() code WC 10.9.1

protected function checkIfGreaterOrEqualToZero(string $name, int $value): void
{
    if ($value < 0) {
        throw new \InvalidArgumentException("\${$name} argument must be greater or equal to 0.");
    }
}