function Assert::range
Inclusive range, so Assert::(3, 3, 5) passes.
@psalm-pure
Parameters
mixed $value:
mixed $min:
mixed $max:
string $message:
Throws
File
-
vendor/
webmozart/ assert/ src/ Assert.php, line 933
Class
- Assert
- Efficient assertions to validate the input/output of your methods.
Namespace
Webmozart\AssertCode
public static function range($value, $min, $max, $message = '') {
if ($value < $min || $value > $max) {
static::reportInvalidArgument(\sprintf($message ?: 'Expected a value between %2$s and %3$s. Got: %s', static::valueToString($value), static::valueToString($min), static::valueToString($max)));
}
}