From b5c88b5cd811f266196dd29c467c76b342c3db9f Mon Sep 17 00:00:00 2001 From: Bruce Weirdan Date: Sat, 19 Sep 2020 00:48:11 +0300 Subject: [PATCH 1/3] Allow errors with pure callables --- tests/acceptance/Prophecy.feature | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/acceptance/Prophecy.feature b/tests/acceptance/Prophecy.feature index 98bcd9e..7fc69c6 100644 --- a/tests/acceptance/Prophecy.feature +++ b/tests/acceptance/Prophecy.feature @@ -89,8 +89,8 @@ Feature: Prophecy """ When I run Psalm Then I see these errors - | Type | Message | - | InvalidScalarArgument | Argument 1 of Prophecy\Argument::that expects callable(mixed...):bool, Closure():string(hello) provided | + | Type | Message | + | InvalidScalarArgument | /Argument 1 of Prophecy\\Argument::that expects callable\(mixed...\):bool, (pure-)?Closure\(\):string\(hello\) provided/ | And I see no other errors Scenario: prophesize() provided by ProphecyTrait is generic From e074fe3e42312e6a04c3a59d4b4b737a84cae92f Mon Sep 17 00:00:00 2001 From: Bruce Weirdan Date: Sat, 19 Sep 2020 00:48:47 +0300 Subject: [PATCH 2/3] Adjust suppression to what newer Psalm version reports --- src/Hooks/TestCaseHandler.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Hooks/TestCaseHandler.php b/src/Hooks/TestCaseHandler.php index eed29ba..4fa4098 100644 --- a/src/Hooks/TestCaseHandler.php +++ b/src/Hooks/TestCaseHandler.php @@ -572,7 +572,10 @@ private static function queueClassLikeForScanning( if (method_exists($codebase, 'queueClassLikeForScanning')) { $codebase->queueClassLikeForScanning($fq_class_name); } else { - /** @psalm-suppress InvalidScalarArgument */ + /** + * @psalm-suppress InvalidScalarArgument + * @psalm-suppress InvalidArgument + */ $codebase->scanner->queueClassLikeForScanning($fq_class_name, $file_path); } } From 54c50d64efe55e2275028641c8cca571a620f981 Mon Sep 17 00:00:00 2001 From: Bruce Weirdan Date: Sat, 19 Sep 2020 00:52:59 +0300 Subject: [PATCH 3/3] Adjust expectations to what Psalm now reports --- tests/acceptance/TestCase.feature | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/acceptance/TestCase.feature b/tests/acceptance/TestCase.feature index d987ccf..34774c3 100644 --- a/tests/acceptance/TestCase.feature +++ b/tests/acceptance/TestCase.feature @@ -142,8 +142,8 @@ Feature: TestCase """ When I run Psalm Then I see these errors - | Type | Message | - | MissingConstructor | NS\MyTestCase has an uninitialized variable $this->i, but no constructor | + | Type | Message | + | MissingConstructor | /NS\\MyTestCase has an uninitialized (variable\|property) \$this->i, but no constructor/ | And I see no other errors Scenario: Missing data provider is reported