Skip to content

Commit 7a79898

Browse files
committed
More precise return type for gatherAssertTypes
1 parent 0d793ec commit 7a79898

File tree

5 files changed

+6
-14
lines changed

5 files changed

+6
-14
lines changed

src/Testing/TypeInferenceTestCase.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -220,8 +220,12 @@ public function assertFileAsserts(
220220
}
221221

222222
/**
223+
* @return array<string, (
224+
* array{0: 'type', 1: string, 2: string, 3: string, 4: int, 5?: string}|
225+
* array{0: 'superType', 1: string, 2: string, 3: string, 4: bool, 5: int, 6?: string}|
226+
* array{0: 'variableCertainty', 1: string, 2: TrinaryLogic, 3: TrinaryLogic, 4: string, 5: int, 6?: string}
227+
* )>
223228
* @api
224-
* @return array<string, mixed[]>
225229
*/
226230
public static function gatherAssertTypes(string $file): array
227231
{
@@ -403,7 +407,7 @@ public static function gatherAssertTypes(string $file): array
403407

404408
/**
405409
* @api
406-
* @return array<string, mixed[]>
410+
* @return array<string, array{string, string, ...<int, mixed>}>
407411
*/
408412
public static function gatherAssertTypesFromDirectory(string $directory): array
409413
{

tests/PHPStan/Analyser/LooseConstComparisonPhp7Test.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,6 @@
88
class LooseConstComparisonPhp7Test extends TypeInferenceTestCase
99
{
1010

11-
/**
12-
* @return iterable<array<string, mixed[]>>
13-
*/
1411
public static function dataFileAsserts(): iterable
1512
{
1613
// compares constants according to the php-version phpstan configuration,

tests/PHPStan/Analyser/LooseConstComparisonPhp8Test.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,6 @@
88
class LooseConstComparisonPhp8Test extends TypeInferenceTestCase
99
{
1010

11-
/**
12-
* @return iterable<array<string, mixed[]>>
13-
*/
1411
public static function dataFileAsserts(): iterable
1512
{
1613
// compares constants according to the php-version phpstan configuration,

tests/PHPStan/Analyser/SubstrPhp7Test.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,6 @@
88
class SubstrPhp7Test extends TypeInferenceTestCase
99
{
1010

11-
/**
12-
* @return iterable<array<string, mixed[]>>
13-
*/
1411
public static function dataFileAsserts(): iterable
1512
{
1613
yield from self::gatherAssertTypes(__DIR__ . '/data/bug-13129-php7.php');

tests/PHPStan/Analyser/SubstrPhp8Test.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,6 @@
88
class SubstrPhp8Test extends TypeInferenceTestCase
99
{
1010

11-
/**
12-
* @return iterable<array<string, mixed[]>>
13-
*/
1411
public static function dataFileAsserts(): iterable
1512
{
1613
yield from self::gatherAssertTypes(__DIR__ . '/data/bug-13129-php8.php');

0 commit comments

Comments
 (0)