File tree Expand file tree Collapse file tree 2 files changed +25
-0
lines changed Expand file tree Collapse file tree 2 files changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -513,6 +513,7 @@ public function dataFileAsserts(): iterable
513
513
yield from $ this ->gatherAssertTypes (__DIR__ . '/data/bug-5501.php ' );
514
514
yield from $ this ->gatherAssertTypes (__DIR__ . '/data/bug-4743.php ' );
515
515
yield from $ this ->gatherAssertTypes (__DIR__ . '/data/bug-5017.php ' );
516
+ yield from $ this ->gatherAssertTypes (__DIR__ . '/data/bug-2760.php ' );
516
517
}
517
518
518
519
/**
Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ namespace Bug2760 ;
4
+
5
+ use function PHPStan \Testing \assertType ;
6
+
7
+ function (): void {
8
+ $ boolean = false ;
9
+ assertType ('false ' , $ boolean );
10
+
11
+ $ fn = function () use (&$ boolean ) : void {
12
+ $ iter = [0 ];
13
+
14
+ foreach ($ iter as $ _ ) {
15
+ $ boolean = true ;
16
+
17
+ return ;
18
+ }
19
+ };
20
+
21
+ $ fn ();
22
+
23
+ assertType ('bool ' , $ boolean );
24
+ };
You can’t perform that action at this time.
0 commit comments