From 7a798984222b2020e0b486657b26bb7465683963 Mon Sep 17 00:00:00 2001 From: Ondrej Mirtes Date: Sun, 30 Nov 2025 14:47:07 +0100 Subject: [PATCH] More precise return type for gatherAssertTypes --- src/Testing/TypeInferenceTestCase.php | 8 ++++++-- tests/PHPStan/Analyser/LooseConstComparisonPhp7Test.php | 3 --- tests/PHPStan/Analyser/LooseConstComparisonPhp8Test.php | 3 --- tests/PHPStan/Analyser/SubstrPhp7Test.php | 3 --- tests/PHPStan/Analyser/SubstrPhp8Test.php | 3 --- 5 files changed, 6 insertions(+), 14 deletions(-) diff --git a/src/Testing/TypeInferenceTestCase.php b/src/Testing/TypeInferenceTestCase.php index f3c998d5dc..1748d992dd 100644 --- a/src/Testing/TypeInferenceTestCase.php +++ b/src/Testing/TypeInferenceTestCase.php @@ -220,8 +220,12 @@ public function assertFileAsserts( } /** + * @return array * @api - * @return array */ public static function gatherAssertTypes(string $file): array { @@ -403,7 +407,7 @@ public static function gatherAssertTypes(string $file): array /** * @api - * @return array + * @return array}> */ public static function gatherAssertTypesFromDirectory(string $directory): array { diff --git a/tests/PHPStan/Analyser/LooseConstComparisonPhp7Test.php b/tests/PHPStan/Analyser/LooseConstComparisonPhp7Test.php index 3b4f48d07a..3139b7a5b9 100644 --- a/tests/PHPStan/Analyser/LooseConstComparisonPhp7Test.php +++ b/tests/PHPStan/Analyser/LooseConstComparisonPhp7Test.php @@ -8,9 +8,6 @@ class LooseConstComparisonPhp7Test extends TypeInferenceTestCase { - /** - * @return iterable> - */ public static function dataFileAsserts(): iterable { // compares constants according to the php-version phpstan configuration, diff --git a/tests/PHPStan/Analyser/LooseConstComparisonPhp8Test.php b/tests/PHPStan/Analyser/LooseConstComparisonPhp8Test.php index fae702cec2..35ade6c0cd 100644 --- a/tests/PHPStan/Analyser/LooseConstComparisonPhp8Test.php +++ b/tests/PHPStan/Analyser/LooseConstComparisonPhp8Test.php @@ -8,9 +8,6 @@ class LooseConstComparisonPhp8Test extends TypeInferenceTestCase { - /** - * @return iterable> - */ public static function dataFileAsserts(): iterable { // compares constants according to the php-version phpstan configuration, diff --git a/tests/PHPStan/Analyser/SubstrPhp7Test.php b/tests/PHPStan/Analyser/SubstrPhp7Test.php index 561b33500c..deb4f19717 100644 --- a/tests/PHPStan/Analyser/SubstrPhp7Test.php +++ b/tests/PHPStan/Analyser/SubstrPhp7Test.php @@ -8,9 +8,6 @@ class SubstrPhp7Test extends TypeInferenceTestCase { - /** - * @return iterable> - */ public static function dataFileAsserts(): iterable { yield from self::gatherAssertTypes(__DIR__ . '/data/bug-13129-php7.php'); diff --git a/tests/PHPStan/Analyser/SubstrPhp8Test.php b/tests/PHPStan/Analyser/SubstrPhp8Test.php index 934a7ac78c..a5da5b57c8 100644 --- a/tests/PHPStan/Analyser/SubstrPhp8Test.php +++ b/tests/PHPStan/Analyser/SubstrPhp8Test.php @@ -8,9 +8,6 @@ class SubstrPhp8Test extends TypeInferenceTestCase { - /** - * @return iterable> - */ public static function dataFileAsserts(): iterable { yield from self::gatherAssertTypes(__DIR__ . '/data/bug-13129-php8.php');