From 1421076bc80ed60258a8a3291dad2a94c9758f12 Mon Sep 17 00:00:00 2001 From: Daniil Gentili Date: Mon, 31 Oct 2022 21:44:32 +0100 Subject: [PATCH] Improve --- src/Hooks/TestCaseHandler.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Hooks/TestCaseHandler.php b/src/Hooks/TestCaseHandler.php index f6b4e5a..0ecf897 100644 --- a/src/Hooks/TestCaseHandler.php +++ b/src/Hooks/TestCaseHandler.php @@ -167,12 +167,12 @@ class TestCaseHandler implements } foreach ($specials['dataProvider'] as $line => $provider) { - if (VersionUtils::packageVersionIs('vimeo/psalm', '>=', '5.0')) { - /** @var CodeLocation */ - $provider_docblock_location = $method_storage->location->setCommentLine($line); - } else { + if (VersionUtils::packageVersionIs('vimeo/psalm', '<', '5.0')) { $provider_docblock_location = clone $method_storage->location; $provider_docblock_location->setCommentLine($line); + } else { + /** @var CodeLocation */ + $provider_docblock_location = $method_storage->location->setCommentLine($line); } if (false !== strpos($provider, '::')) {