| @@ 990-999 (lines=10) @@ | ||
| 987 | ); |
|
| 988 | } |
|
| 989 | ||
| 990 | public static function minCount($array, $min, $message = '') |
|
| 991 | { |
|
| 992 | if (count($array) < $min) { |
|
| 993 | static::reportInvalidArgument(sprintf( |
|
| 994 | $message ?: 'Expected an array to contain at least %2$d elements. Got: %d', |
|
| 995 | count($array), |
|
| 996 | $min |
|
| 997 | )); |
|
| 998 | } |
|
| 999 | } |
|
| 1000 | ||
| 1001 | public static function maxCount($array, $max, $message = '') |
|
| 1002 | { |
|
| @@ 1001-1010 (lines=10) @@ | ||
| 998 | } |
|
| 999 | } |
|
| 1000 | ||
| 1001 | public static function maxCount($array, $max, $message = '') |
|
| 1002 | { |
|
| 1003 | if (count($array) > $max) { |
|
| 1004 | static::reportInvalidArgument(sprintf( |
|
| 1005 | $message ?: 'Expected an array to contain at most %2$d elements. Got: %d', |
|
| 1006 | count($array), |
|
| 1007 | $max |
|
| 1008 | )); |
|
| 1009 | } |
|
| 1010 | } |
|
| 1011 | ||
| 1012 | public static function countBetween($array, $min, $max, $message = '') |
|
| 1013 | { |
|