Skip to content

Commit 434d089

Browse files
staabmsebastianbergmann
authored andcommitted
Fix "PHPDoc tag @phpstan-assert for $array has no value type specified in iterable type"
1 parent b831ae5 commit 434d089

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

src/Framework/Assert.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ final public static function assertArrayNotHasKey(int|string $key, array|ArrayAc
195195
}
196196

197197
/**
198-
* @phpstan-assert list $array
198+
* @phpstan-assert list<mixed> $array
199199
*
200200
* @throws ExpectationFailedException
201201
*/
@@ -1198,7 +1198,7 @@ final public static function assertNotInstanceOf(string $expected, mixed $actual
11981198
* @throws Exception
11991199
* @throws ExpectationFailedException
12001200
*
1201-
* @phpstan-assert array $actual
1201+
* @phpstan-assert array<mixed> $actual
12021202
*/
12031203
final public static function assertIsArray(mixed $actual, string $message = ''): void
12041204
{
@@ -1385,7 +1385,7 @@ final public static function assertIsCallable(mixed $actual, string $message = '
13851385
* @throws Exception
13861386
* @throws ExpectationFailedException
13871387
*
1388-
* @phpstan-assert iterable $actual
1388+
* @phpstan-assert iterable<mixed> $actual
13891389
*/
13901390
final public static function assertIsIterable(mixed $actual, string $message = ''): void
13911391
{
@@ -1402,7 +1402,7 @@ final public static function assertIsIterable(mixed $actual, string $message = '
14021402
* @throws Exception
14031403
* @throws ExpectationFailedException
14041404
*
1405-
* @phpstan-assert !array $actual
1405+
* @phpstan-assert !array<mixed> $actual
14061406
*/
14071407
final public static function assertIsNotArray(mixed $actual, string $message = ''): void
14081408
{
@@ -1589,7 +1589,7 @@ final public static function assertIsNotCallable(mixed $actual, string $message
15891589
* @throws Exception
15901590
* @throws ExpectationFailedException
15911591
*
1592-
* @phpstan-assert !iterable $actual
1592+
* @phpstan-assert !iterable<mixed> $actual
15931593
*/
15941594
final public static function assertIsNotIterable(mixed $actual, string $message = ''): void
15951595
{

src/Framework/Assert/Functions.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ function assertArrayNotHasKey(int|string $key, array|ArrayAccess $array, string
193193

194194
if (!function_exists('PHPUnit\Framework\assertIsList')) {
195195
/**
196-
* @phpstan-assert list $array
196+
* @phpstan-assert list<mixed> $array
197197
*
198198
* @throws ExpectationFailedException
199199
*
@@ -1379,7 +1379,7 @@ function assertNotInstanceOf(string $expected, mixed $actual, string $message =
13791379
* @throws Exception
13801380
* @throws ExpectationFailedException
13811381
*
1382-
* @phpstan-assert array $actual
1382+
* @phpstan-assert array<mixed> $actual
13831383
*
13841384
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
13851385
*
@@ -1588,7 +1588,7 @@ function assertIsCallable(mixed $actual, string $message = ''): void
15881588
* @throws Exception
15891589
* @throws ExpectationFailedException
15901590
*
1591-
* @phpstan-assert iterable $actual
1591+
* @phpstan-assert iterable<mixed> $actual
15921592
*
15931593
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
15941594
*
@@ -1607,7 +1607,7 @@ function assertIsIterable(mixed $actual, string $message = ''): void
16071607
* @throws Exception
16081608
* @throws ExpectationFailedException
16091609
*
1610-
* @phpstan-assert !array $actual
1610+
* @phpstan-assert !array<mixed> $actual
16111611
*
16121612
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
16131613
*
@@ -1816,7 +1816,7 @@ function assertIsNotCallable(mixed $actual, string $message = ''): void
18161816
* @throws Exception
18171817
* @throws ExpectationFailedException
18181818
*
1819-
* @phpstan-assert !iterable $actual
1819+
* @phpstan-assert !iterable<mixed> $actual
18201820
*
18211821
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
18221822
*

0 commit comments

Comments
 (0)