1 | <?php |
||
17 | final class InvalidArgumentException extends BaseException |
||
18 | { |
||
19 | 9 | public static function invalidType(string $argument, string $expectedType, $actualValue): self |
|
28 | |||
29 | 15 | public static function invalidValueInArray(string $argument, string $expectedType, $actualValue): self |
|
30 | { |
||
31 | 15 | return self::create( |
|
32 | 15 | 'Each value in argument $%s must be of type %s, %s given', |
|
33 | 15 | $argument, |
|
34 | 15 | $expectedType, |
|
35 | 15 | $actualValue |
|
36 | ); |
||
37 | } |
||
38 | |||
39 | 12 | public static function invalidKeyInArray(string $argument, string $expectedType, $actualValue): self |
|
40 | { |
||
41 | 12 | return self::create( |
|
42 | 12 | 'Each key in argument $%s must be of type %s, %s given', |
|
43 | 12 | $argument, |
|
44 | 12 | $expectedType, |
|
45 | 12 | $actualValue |
|
46 | ); |
||
47 | } |
||
48 | |||
49 | 36 | private static function create(string $message, string $argument, string $expectedType, $actualValue): self |
|
61 | } |
||
62 |