| @@ 944-953 (lines=10) @@ | ||
| 941 | ); |
|
| 942 | } |
|
| 943 | ||
| 944 | public static function minCount($array, $min, $message = '') |
|
| 945 | { |
|
| 946 | if (count($array) < $min) { |
|
| 947 | static::reportInvalidArgument(sprintf( |
|
| 948 | $message ?: 'Expected an array to contain at least %2$d elements. Got: %d', |
|
| 949 | count($array), |
|
| 950 | $min |
|
| 951 | )); |
|
| 952 | } |
|
| 953 | } |
|
| 954 | ||
| 955 | public static function maxCount($array, $max, $message = '') |
|
| 956 | { |
|
| @@ 955-964 (lines=10) @@ | ||
| 952 | } |
|
| 953 | } |
|
| 954 | ||
| 955 | public static function maxCount($array, $max, $message = '') |
|
| 956 | { |
|
| 957 | if (count($array) > $max) { |
|
| 958 | static::reportInvalidArgument(sprintf( |
|
| 959 | $message ?: 'Expected an array to contain at most %2$d elements. Got: %d', |
|
| 960 | count($array), |
|
| 961 | $max |
|
| 962 | )); |
|
| 963 | } |
|
| 964 | } |
|
| 965 | ||
| 966 | public static function countBetween($array, $min, $max, $message = '') |
|
| 967 | { |
|