Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit a339873

Browse files
More tests - proving bugs in Rector
1 parent e86d190 commit a339873

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

‎tests/PHPStan/Analyser/data/assert-methods.php‎

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,26 @@ public function doBar($mixed)
3030
assertType('iterable<class-string<stdClass>|stdClass>', $mixed);
3131
}
3232

33+
/**
34+
* @param array<object> $objects
35+
* @return void
36+
*/
37+
public function doBar2(array $objects)
38+
{
39+
self::doFoo($objects, stdClass::class);
40+
assertType('array<stdClass>', $objects);
41+
}
42+
43+
/**
44+
* @param array<string> $strings
45+
* @return void
46+
*/
47+
public function doBar3(array $strings)
48+
{
49+
self::doFoo($strings, stdClass::class);
50+
assertType('array<class-string<stdClass>>', $strings);
51+
}
52+
3353
/**
3454
* @template ExpectedType of object
3555
* @param class-string<ExpectedType> $class

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /