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