Skip to content

Commit 9b938c3

Browse files
committed
Added regression test
1 parent d11ab42 commit 9b938c3

File tree

2 files changed

+30
-0
lines changed

2 files changed

+30
-0
lines changed

tests/PHPStan/Rules/DeadCode/UnreachableStatementRuleTest.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -361,6 +361,12 @@ public function testBug13311(): void
361361
$this->analyse([__DIR__ . '/data/bug-13311.php'], []);
362362
}
363363

364+
public function testBug13307(): void
365+
{
366+
$this->treatPhpDocTypesAsCertain = false;
367+
$this->analyse([__DIR__ . '/data/bug-13307.php'], []);
368+
}
369+
364370
public function testBug13331(): void
365371
{
366372
$this->treatPhpDocTypesAsCertain = false;
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<?php
2+
3+
namespace Bug13307;
4+
5+
function dd(): never {
6+
exit(1);
7+
}
8+
9+
class HelloWorld
10+
{
11+
public function testMethod(): string
12+
{
13+
var_dump("dd");
14+
15+
return "test";
16+
}
17+
18+
public function testMethod2(): string
19+
{
20+
var_dump("DD");
21+
22+
return "test";
23+
}
24+
}

0 commit comments

Comments
 (0)