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