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