We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3ba48c9 commit f868b58Copy full SHA for f868b58
tests/PHPStan/Rules/DeadCode/UnreachableStatementRuleTest.php
@@ -241,6 +241,18 @@ public function testMultipleUnreachable(): void
241
]);
242
}
243
244
+ #[RequiresPhp('>= 8.1')]
245
+ public function testBug11909(): void
246
+ {
247
+ $this->treatPhpDocTypesAsCertain = false;
248
+ $this->analyse([__DIR__ . '/data/bug-11909.php'], [
249
+ [
250
+ 'Unreachable statement - code above always terminates.',
251
+ 10,
252
+ ],
253
+ ]);
254
+ }
255
+
256
#[RequiresPhp('>= 8.1')]
257
public function testBug13232a(): void
258
{
tests/PHPStan/Rules/DeadCode/data/bug-11909.php
@@ -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