| @@ 968-977 (lines=10) @@ | ||
| 965 | ); |
|
| 966 | } |
|
| 967 | ||
| 968 | public static function minCount($array, $min, $message = '') |
|
| 969 | { |
|
| 970 | if (count($array) < $min) { |
|
| 971 | static::reportInvalidArgument(sprintf( |
|
| 972 | $message ?: 'Expected an array to contain at least %2$d elements. Got: %d', |
|
| 973 | count($array), |
|
| 974 | $min |
|
| 975 | )); |
|
| 976 | } |
|
| 977 | } |
|
| 978 | ||
| 979 | public static function maxCount($array, $max, $message = '') |
|
| 980 | { |
|
| @@ 979-988 (lines=10) @@ | ||
| 976 | } |
|
| 977 | } |
|
| 978 | ||
| 979 | public static function maxCount($array, $max, $message = '') |
|
| 980 | { |
|
| 981 | if (count($array) > $max) { |
|
| 982 | static::reportInvalidArgument(sprintf( |
|
| 983 | $message ?: 'Expected an array to contain at most %2$d elements. Got: %d', |
|
| 984 | count($array), |
|
| 985 | $max |
|
| 986 | )); |
|
| 987 | } |
|
| 988 | } |
|
| 989 | ||
| 990 | public static function countBetween($array, $min, $max, $message = '') |
|
| 991 | { |
|