if ($ruleValue === null
) { return self::
isNegativeOperator($operator);
} return match ($operator) { Rule::OPERATOR_GTE => FloatComparator::
greaterThanOrEquals($itemValue,
$ruleValue),
Rule::OPERATOR_LTE => FloatComparator::
lessThanOrEquals($itemValue,
$ruleValue),
Rule::OPERATOR_GT => FloatComparator::
greaterThan($itemValue,
$ruleValue),
Rule::OPERATOR_LT => FloatComparator::
lessThan($itemValue,
$ruleValue),
Rule::OPERATOR_EQ => FloatComparator::
equals($itemValue,
$ruleValue),
Rule::OPERATOR_NEQ => FloatComparator::
notEquals($itemValue,
$ruleValue),
default =>
throw new UnsupportedOperatorException($operator, self::
class),
};
} public static function string(?string
$itemValue, string
$ruleValue, string
$operator): bool
{ if ($itemValue === null
) { $itemValue = '';
} return match ($operator) { Rule::OPERATOR_EQ =>
strcasecmp($ruleValue,
$itemValue) === 0,