| @@ 1033-1042 (lines=10) @@ | ||
| 1030 | ); |
|
| 1031 | } |
|
| 1032 | ||
| 1033 | public static function minCount($array, $min, $message = '') |
|
| 1034 | { |
|
| 1035 | if (count($array) < $min) { |
|
| 1036 | static::reportInvalidArgument(sprintf( |
|
| 1037 | $message ?: 'Expected an array to contain at least %2$d elements. Got: %d', |
|
| 1038 | count($array), |
|
| 1039 | $min |
|
| 1040 | )); |
|
| 1041 | } |
|
| 1042 | } |
|
| 1043 | ||
| 1044 | public static function maxCount($array, $max, $message = '') |
|
| 1045 | { |
|
| @@ 1044-1053 (lines=10) @@ | ||
| 1041 | } |
|
| 1042 | } |
|
| 1043 | ||
| 1044 | public static function maxCount($array, $max, $message = '') |
|
| 1045 | { |
|
| 1046 | if (count($array) > $max) { |
|
| 1047 | static::reportInvalidArgument(sprintf( |
|
| 1048 | $message ?: 'Expected an array to contain at most %2$d elements. Got: %d', |
|
| 1049 | count($array), |
|
| 1050 | $max |
|
| 1051 | )); |
|
| 1052 | } |
|
| 1053 | } |
|
| 1054 | ||
| 1055 | public static function countBetween($array, $min, $max, $message = '') |
|
| 1056 | { |
|