Number
class Number extends NumberComparator (View source)
Check if the input matches the min and max values.
If min and max are equal, the count must match that value regardless of the inclusive flag.
Methods
__construct(int|float $min = null, int|float $max = null, bool $inclusive = true)
No description
static Number
between(int|float $min, int|float $max, bool $inclusive = true)
Must be between the given minimum and maximum.
bool
checkNumber(int|float $value)
Compare the input number against the comparator.
static Number
make(int|float $min = null, int|float $max = null, bool $inclusive = true)
No description
Details
__construct(int|float $min = null, int|float $max = null, bool $inclusive = true)
No description
final bool
__invoke(mixed $value)
Compare the input value against the comparator.
static Number
between(int|float $min, int|float $max, bool $inclusive = true)
Must be between the given minimum and maximum.
final bool
check(mixed $value)
Compare the input number against the comparator.
protected bool
checkNumber(int|float $value)
Compare the input number against the comparator.
static Number
equal(int|float $size)
Must be equal to the given size.
static Number
make(int|float $min = null, int|float $max = null, bool $inclusive = true)
No description
static Number
max(int|float $max, bool $inclusive = true)
Must be less than or equal to the given maximum.
static Number
min(int|float $min, bool $inclusive = true)
Must be greater than or equal to the given minimum.