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 | 46 | public static function atLeast(string $functionName, int $min): self |
|
20 | { |
||
21 | 46 | return new self(\sprintf( |
|
22 | 46 | '%s() requires at least %d argument%s', |
|
23 | 46 | $functionName, |
|
24 | 46 | $min, |
|
25 | 46 | $min === 1 ? '' : 's' |
|
26 | 46 | )); |
|
27 | } |
||
28 | |||
29 | 47 | public static function between(string $functionName, int $min, int $max): self |
|
36 | 47 | )); |
|
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 |