Skip to content

Commit de17c04

Browse files
committed
fix build
1 parent 20e3f3b commit de17c04

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
@@ -2930,7 +2930,7 @@ static function (): void {
29302930
$exprResult->getImpurePoints(),
29312931
static fn (): MutatingScope => $scope->filterByTruthyValue($expr),
29322932
static fn (): MutatingScope => $scope->filterByFalseyValue($expr),
2933-
$exprResult->isAlwaysTerminating()
2933+
$exprResult->isAlwaysTerminating(),
29342934
);
29352935
} elseif ($expr instanceof StaticCall) {
29362936
$hasYield = false;
@@ -5801,7 +5801,7 @@ static function (): void {
58015801
$hasYield = $result->hasYield();
58025802
$throwPoints = array_merge($throwPoints, $result->getThrowPoints());
58035803
$impurePoints = array_merge($impurePoints, $result->getImpurePoints());
5804-
$isAlwaysTerminating = $isAlwaysTerminating || $result->isAlwaysTerminating();
5804+
$isAlwaysTerminating = $result->isAlwaysTerminating();
58055805
$scope = $result->getScope();
58065806
foreach ($var->items as $i => $arrayItem) {
58075807
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>
@@ -240,6 +241,7 @@ public function testMultipleUnreachable(): void
240241
]);
241242
}
242243

244+
#[RequiresPhp('>= 8.1')]
243245
public function testBug13232a(): void
244246
{
245247
$this->treatPhpDocTypesAsCertain = false;
@@ -251,6 +253,7 @@ public function testBug13232a(): void
251253
]);
252254
}
253255

256+
#[RequiresPhp('>= 8.1')]
254257
public function testBug13232b(): void
255258
{
256259
$this->treatPhpDocTypesAsCertain = false;
@@ -262,6 +265,7 @@ public function testBug13232b(): void
262265
]);
263266
}
264267

268+
#[RequiresPhp('>= 8.1')]
265269
public function testBug13232c(): void
266270
{
267271
$this->treatPhpDocTypesAsCertain = false;
@@ -277,6 +281,7 @@ public function testBug13232c(): void
277281
]);
278282
}
279283

284+
#[RequiresPhp('>= 8.1')]
280285
public function testBug13232d(): void
281286
{
282287
$this->treatPhpDocTypesAsCertain = false;

0 commit comments

Comments
 (0)