From 50f224c5aae58852693ba332d97b26135fca6841 Mon Sep 17 00:00:00 2001 From: Matthew Brown Date: Mon, 12 Oct 2020 20:42:16 -0400 Subject: [PATCH 1/2] Require master --- composer.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index 4b2db45..0b5c3a9 100755 --- a/composer.json +++ b/composer.json @@ -14,12 +14,12 @@ "sort-packages": true }, "require": { - "php": "^7.1.3 || ^8.0", + "php": "^7.3 || ^8.0", "ext-simplexml": "*", "composer/semver": "^1.4 || ^2.0 || ^3.0", "composer/package-versions-deprecated": "^1.10", "phpunit/phpunit": "^7.5 || ^8.0 || ^9.0", - "vimeo/psalm": "^3.6.2 || dev-master || dev-4.x" + "vimeo/psalm": "dev-master || dev-4.x" }, "require-dev": { "codeception/codeception": "^4.0.3", From 74d4318bef96a2d84a90143627c0c22fe7c2ffa3 Mon Sep 17 00:00:00 2001 From: Matt Brown Date: Tue, 13 Oct 2020 00:38:14 -0400 Subject: [PATCH 2/2] Change to TKeyedArray --- 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 4fa4098..7d49980 100644 --- a/src/Hooks/TestCaseHandler.php +++ b/src/Hooks/TestCaseHandler.php @@ -343,7 +343,7 @@ class TestCaseHandler implements } }; - /** @var Type\Atomic\TArray|Type\Atomic\ObjectLike|Type\Atomic\TList $dataset_type */ + /** @var Type\Atomic\TArray|Type\Atomic\TKeyedArray|Type\Atomic\TList $dataset_type */ $dataset_type = self::getAtomics($provider_return_type->type_params[1])['array']; if ($dataset_type instanceof Type\Atomic\TArray) { @@ -363,7 +363,7 @@ class TestCaseHandler implements } $checkParam($potential_argument_type, $param->type, $param->is_optional, $param_offset); } - } else { // ObjectLike + } else { // TKeyedArray // iterate over all params checking if corresponding value type is acceptable // let's hope properties are sorted in array order $potential_argument_types = array_values($dataset_type->properties); @@ -449,7 +449,7 @@ class TestCaseHandler implements if ($type instanceof Type\Atomic\TArray) { $key_types[] = $type->type_params[0] ?? Type::getMixed(); $value_types[] = $type->type_params[1] ?? Type::getMixed(); - } elseif ($type instanceof Type\Atomic\ObjectLike) { + } elseif ($type instanceof Type\Atomic\TKeyedArray) { $key_types[] = $type->getGenericKeyType(); $value_types[] = $type->getGenericValueType(); } elseif ($type instanceof Type\Atomic\TNamedObject || $type instanceof Type\Atomic\TIterable) {