| Total Complexity | 7 |
| Total Lines | 47 |
| Duplicated Lines | 0 % |
| Coverage | 81.25% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 7 | class InvalidArgumentForVariadicFunctionException extends \InvalidArgumentException |
||
| 8 | { |
||
| 9 | 2 | public static function exactCount(string $functionName, int $expected): self |
|
| 10 | { |
||
| 11 | 2 | return new self(\sprintf( |
|
| 12 | 2 | '%s() requires exactly %d argument%s', |
|
| 13 | 2 | $functionName, |
|
| 14 | 2 | $expected, |
|
| 15 | 2 | $expected === 1 ? '' : 's' |
|
| 16 | 2 | )); |
|
| 17 | } |
||
| 18 | |||
| 19 | 51 | public static function atLeast(string $functionName, int $min): self |
|
| 20 | { |
||
| 21 | 51 | return new self(\sprintf( |
|
| 22 | 51 | '%s() requires at least %d argument%s', |
|
| 23 | 51 | $functionName, |
|
| 24 | 51 | $min, |
|
| 25 | 51 | $min === 1 ? '' : 's' |
|
| 26 | 51 | )); |
|
| 27 | } |
||
| 28 | |||
| 29 | 53 | public static function between(string $functionName, int $min, int $max): self |
|
| 36 | 53 | )); |
|
| 37 | } |
||
| 38 | |||
| 39 | 2 | public static function evenNumber(string $functionName): self |
|
| 44 | 2 | )); |
|
| 45 | } |
||
| 46 | |||
| 47 | public static function unsupportedCombination(string $functionName, int $count, string $note): self |
||
| 54 | )); |
||
| 55 | } |
||
| 57 |