File tree Expand file tree Collapse file tree 3 files changed +36
-0
lines changed
tests/PHPStan/Rules/Missing Expand file tree Collapse file tree 3 files changed +36
-0
lines changed Original file line number Diff line number Diff line change @@ -325,10 +325,22 @@ public function testBug9309(): void
325325 $ this ->analyse ([__DIR__ . '/data/bug-9309.php ' ], []);
326326 }
327327
328+ public function testBug6807 (): void
329+ {
330+ $ this ->checkExplicitMixedMissingReturn = true ;
331+ $ this ->analyse ([__DIR__ . '/data/bug-6807.php ' ], []);
332+ }
333+
328334 public function testBug8463 (): void
329335 {
330336 $ this ->checkExplicitMixedMissingReturn = true ;
331337 $ this ->analyse ([__DIR__ . '/data/bug-8463.php ' ], []);
332338 }
333339
340+ public function testBug9374 (): void
341+ {
342+ $ this ->checkExplicitMixedMissingReturn = true ;
343+ $ this ->analyse ([__DIR__ . '/data/bug-9374.php ' ], []);
344+ }
345+
334346}
Original file line number Diff line number Diff line change 1+ <?php declare (strict_types = 1 );
2+
3+ namespace Bug6807 ;
4+
5+ /** @return int */
6+ function test ()
7+ {
8+ for ($ attempts = 0 ; ; $ attempts ++)
9+ {
10+ if ($ attempts > 5 )
11+ throw new Exception ();
12+
13+ if (rand () == 1 )
14+ return 5 ;
15+ }
16+ }
Original file line number Diff line number Diff line change 1+ <?php declare (strict_types = 1 );
2+
3+ namespace Bug9374 ;
4+
5+ function bar (): string {
6+ for ($ i = 0 ; ; ++$ i )
7+ return "" ;
8+ }
You can’t perform that action at this time.
0 commit comments