Skip to content

Commit 8d1dce7

Browse files
committed
added regression test
1 parent 7d1cf8d commit 8d1dce7

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

tests/PHPStan/Rules/DeadCode/UnreachableStatementRuleTest.php

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

364+
public function testBug13331(): void
365+
{
366+
$this->treatPhpDocTypesAsCertain = false;
367+
$this->analyse([__DIR__ . '/data/bug-13331.php'], []);
368+
}
369+
364370
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?php declare(strict_types = 1);
2+
3+
namespace Bug13331;
4+
5+
$signalHandler = function () {
6+
exit();
7+
};
8+
9+
pcntl_async_signals(true);
10+
pcntl_signal(SIGINT, $signalHandler);
11+
pcntl_signal(SIGQUIT, $signalHandler);
12+
pcntl_signal(SIGTERM, $signalHandler);

0 commit comments

Comments
 (0)