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