From ccd317fd466f5b0ea44eca51b8201efdc7d6ac4d Mon Sep 17 00:00:00 2001 From: Bruce Weirdan Date: Fri, 11 Dec 2020 00:45:38 +0200 Subject: [PATCH] Assume mixed params when no type is provided --- src/Hooks/TestCaseHandler.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Hooks/TestCaseHandler.php b/src/Hooks/TestCaseHandler.php index e76ec71..eb20931 100644 --- a/src/Hooks/TestCaseHandler.php +++ b/src/Hooks/TestCaseHandler.php @@ -393,9 +393,9 @@ class TestCaseHandler implements } $potential_argument_type = $potential_argument_types[$param_offset]; - assert(null !== $param->type); + $param_type = $param->type === null ? Type::getMixed() : $param->type; if ($param->is_variadic) { - $param_types = self::getAtomics($param->type); + $param_types = self::getAtomics($param_type); $variadic_param_type = new Type\Union(array_values($param_types)); // check remaining argument types @@ -411,7 +411,7 @@ class TestCaseHandler implements break; } - $checkParam($potential_argument_type, $param->type, $param->is_optional, $param_offset); + $checkParam($potential_argument_type, $param_type, $param->is_optional, $param_offset); } } }