function Assert::countBetween
Does not check if $array is countable, this can generate a warning on php versions after 7.2.
Parameters
Countable|array $array:
int|float $min:
int|float $max:
string $message:
Throws
File
-
vendor/
webmozart/ assert/ src/ Assert.php, line 1800
Class
- Assert
- Efficient assertions to validate the input/output of your methods.
Namespace
Webmozart\AssertCode
public static function countBetween($array, $min, $max, $message = '') {
$count = \count($array);
if ($count < $min || $count > $max) {
static::reportInvalidArgument(\sprintf($message ?: 'Expected an array to contain between %2$d and %3$d elements. Got: %d', $count, $min, $max));
}
}