File tree Expand file tree Collapse file tree 2 files changed +30
-0
lines changed Expand file tree Collapse file tree 2 files changed +30
-0
lines changed Original file line number Diff line number Diff line change @@ -10274,6 +10274,11 @@ public function dataNeverEarlyTerminates(): array
1027410274 return $ this ->gatherAssertTypes (__DIR__ . '/data/early-termination-phpdoc.php ' );
1027510275 }
1027610276
10277+ public function dataBug3915 (): array
10278+ {
10279+ return $ this ->gatherAssertTypes (__DIR__ . '/data/bug-3915.php ' );
10280+ }
10281+
1027710282 /**
1027810283 * @param string $file
1027910284 * @return array<string, mixed[]>
@@ -10443,6 +10448,7 @@ private function gatherAssertTypes(string $file): array
1044310448 * @dataProvider dataBug4016
1044410449 * @dataProvider dataPromotedProperties
1044510450 * @dataProvider dataNeverEarlyTerminates
10451+ * @dataProvider dataBug3915
1044610452 * @param string $assertType
1044710453 * @param string $file
1044810454 * @param mixed ...$args
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ namespace Bug3915 ;
4+
5+ use function PHPStan \Analyser \assertType ;
6+
7+ class HelloWorld
8+ {
9+
10+ public function sayHello (): void
11+ {
12+ $ lengths = [0 ];
13+ foreach ([1 ] as $ row ) {
14+ $ lengths [] = self ::getInt ();
15+ }
16+ assertType ('array<int, int>&nonEmpty ' , $ lengths );
17+ }
18+
19+ public static function getInt (): int
20+ {
21+ return 5 ;
22+ }
23+
24+ }
You can’t perform that action at this time.
0 commit comments