| @@ 958-967 (lines=10) @@ | ||
| 955 | ); |
|
| 956 | } |
|
| 957 | ||
| 958 | public static function minCount($array, $min, $message = '') |
|
| 959 | { |
|
| 960 | if (count($array) < $min) { |
|
| 961 | static::reportInvalidArgument(sprintf( |
|
| 962 | $message ?: 'Expected an array to contain at least %2$d elements. Got: %d', |
|
| 963 | count($array), |
|
| 964 | $min |
|
| 965 | )); |
|
| 966 | } |
|
| 967 | } |
|
| 968 | ||
| 969 | public static function maxCount($array, $max, $message = '') |
|
| 970 | { |
|
| @@ 969-978 (lines=10) @@ | ||
| 966 | } |
|
| 967 | } |
|
| 968 | ||
| 969 | public static function maxCount($array, $max, $message = '') |
|
| 970 | { |
|
| 971 | if (count($array) > $max) { |
|
| 972 | static::reportInvalidArgument(sprintf( |
|
| 973 | $message ?: 'Expected an array to contain at most %2$d elements. Got: %d', |
|
| 974 | count($array), |
|
| 975 | $max |
|
| 976 | )); |
|
| 977 | } |
|
| 978 | } |
|
| 979 | ||
| 980 | public static function countBetween($array, $min, $max, $message = '') |
|
| 981 | { |
|