@@ 51-58 (lines=8) @@ | ||
48 | * @return void |
|
49 | * @throws InvalidArgumentException |
|
50 | */ |
|
51 | public static function assertArgumentType($argumentPosition, $function, $expectedType, $providedArgument) |
|
52 | { |
|
53 | $ok = self::checkArgumentType($expectedType, $providedArgument); |
|
54 | if (! $ok) { |
|
55 | $providedType = gettype($providedArgument); |
|
56 | throw self::createInvalidArgumentException($argumentPosition, $function, $expectedType, $providedType); |
|
57 | } |
|
58 | } |
|
59 | ||
60 | /** |
|
61 | * @param int $argumentPosition |
|
@@ 68-75 (lines=8) @@ | ||
65 | * @return void |
|
66 | * @throws InvalidArgumentException |
|
67 | */ |
|
68 | public static function assertArgumentTypes($argumentPosition, $function, $expectedTypes, $providedArgument) |
|
69 | { |
|
70 | $ok = self::checkArgumentTypes($expectedTypes, $providedArgument); |
|
71 | if (! $ok) { |
|
72 | $providedType = gettype($providedArgument); |
|
73 | throw self::createInvalidArgumentException($argumentPosition, $function, $expectedTypes, $providedType); |
|
74 | } |
|
75 | } |
|
76 | ||
77 | /** |
|
78 | * @param int $argumentPosition |