Total Complexity | 7 |
Total Lines | 47 |
Duplicated Lines | 0 % |
Coverage | 59.38% |
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 | 44 | public static function atLeast(string $functionName, int $min): self |
|
20 | { |
||
21 | 44 | return new self(\sprintf( |
|
22 | 44 | '%s() requires at least %d argument%s', |
|
23 | 44 | $functionName, |
|
24 | 44 | $min, |
|
25 | 44 | $min === 1 ? '' : 's' |
|
26 | 44 | )); |
|
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 |
||
57 |