2 declare(strict_types=1);
19 if (!preg_match(
'#^\s*(==|!=|[<>]=?)?\s*([0-9\.]+)\s*([kmg]i?)?\s*$#i', $test, $matches)) {
20 throw new \InvalidArgumentException(sprintf(
'Don\'t understand "%s" as a number test.', $test));
25 throw new \InvalidArgumentException(sprintf(
'Invalid number "%s".',
$target));
28 if (isset($matches[3])) {
30 switch (strtolower($matches[3])) {
__construct(string $test)
NumberComparator constructor.
setOperator(string $operator)
setTarget(string $target)