Skip to content

Commit 3b86e57

Browse files
committed
fix build
1 parent 2e56803 commit 3b86e57

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

src/Analyser/NodeScopeResolver.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2933,7 +2933,7 @@ static function (): void {
29332933
$exprResult->getImpurePoints(),
29342934
static fn (): MutatingScope => $scope->filterByTruthyValue($expr),
29352935
static fn (): MutatingScope => $scope->filterByFalseyValue($expr),
2936-
$exprResult->isAlwaysTerminating()
2936+
$exprResult->isAlwaysTerminating(),
29372937
);
29382938
} elseif ($expr instanceof StaticCall) {
29392939
$hasYield = false;
@@ -5804,7 +5804,7 @@ static function (): void {
58045804
$hasYield = $result->hasYield();
58055805
$throwPoints = array_merge($throwPoints, $result->getThrowPoints());
58065806
$impurePoints = array_merge($impurePoints, $result->getImpurePoints());
5807-
$isAlwaysTerminating = $isAlwaysTerminating || $result->isAlwaysTerminating();
5807+
$isAlwaysTerminating = $result->isAlwaysTerminating();
58085808
$scope = $result->getScope();
58095809
foreach ($var->items as $i => $arrayItem) {
58105810
if ($arrayItem === null) {

tests/PHPStan/Rules/DeadCode/UnreachableStatementRuleTest.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
use PHPStan\Rules\Rule;
66
use PHPStan\Testing\RuleTestCase;
77
use PHPUnit\Framework\Attributes\DataProvider;
8+
use PHPUnit\Framework\Attributes\RequiresPhp;
89

910
/**
1011
* @extends RuleTestCase<UnreachableStatementRule>
@@ -251,6 +252,7 @@ public function testMultipleUnreachable(): void
251252
]);
252253
}
253254

255+
#[RequiresPhp('>= 8.1')]
254256
public function testBug13232a(): void
255257
{
256258
$this->treatPhpDocTypesAsCertain = false;
@@ -262,6 +264,7 @@ public function testBug13232a(): void
262264
]);
263265
}
264266

267+
#[RequiresPhp('>= 8.1')]
265268
public function testBug13232b(): void
266269
{
267270
$this->treatPhpDocTypesAsCertain = false;
@@ -273,6 +276,7 @@ public function testBug13232b(): void
273276
]);
274277
}
275278

279+
#[RequiresPhp('>= 8.1')]
276280
public function testBug13232c(): void
277281
{
278282
$this->treatPhpDocTypesAsCertain = false;
@@ -288,6 +292,7 @@ public function testBug13232c(): void
288292
]);
289293
}
290294

295+
#[RequiresPhp('>= 8.1')]
291296
public function testBug13232d(): void
292297
{
293298
$this->treatPhpDocTypesAsCertain = false;

0 commit comments

Comments
 (0)