Skip to content

Commit e6be0b0

Browse files
committed
added regression test
1 parent acee25b commit e6be0b0

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

tests/PHPStan/Rules/DeadCode/UnreachableStatementRuleTest.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,18 @@ public function testMultipleUnreachable(): void
252252
]);
253253
}
254254

255+
#[RequiresPhp('>= 8.1')]
256+
public function testBug11909(): void
257+
{
258+
$this->treatPhpDocTypesAsCertain = false;
259+
$this->analyse([__DIR__ . '/data/bug-11909.php'], [
260+
[
261+
'Unreachable statement - code above always terminates.',
262+
10,
263+
],
264+
]);
265+
}
266+
255267
#[RequiresPhp('>= 8.1')]
256268
public function testBug13232a(): void
257269
{
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?php declare(strict_types = 1);
2+
3+
namespace Bug11909;
4+
5+
function doFoo(): never {
6+
throw new LogicException("throws");
7+
}
8+
9+
echo doFoo();
10+
echo "hello";

0 commit comments

Comments
 (0)