Skip to content

Commit df13be8

Browse files
committed
fix build
1 parent 63ae404 commit df13be8

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
@@ -2931,7 +2931,7 @@ static function (): void {
29312931
$exprResult->getImpurePoints(),
29322932
static fn (): MutatingScope => $scope->filterByTruthyValue($expr),
29332933
static fn (): MutatingScope => $scope->filterByFalseyValue($expr),
2934-
$exprResult->isAlwaysTerminating()
2934+
$exprResult->isAlwaysTerminating(),
29352935
);
29362936
} elseif ($expr instanceof StaticCall) {
29372937
$hasYield = false;
@@ -5802,7 +5802,7 @@ static function (): void {
58025802
$hasYield = $result->hasYield();
58035803
$throwPoints = array_merge($throwPoints, $result->getThrowPoints());
58045804
$impurePoints = array_merge($impurePoints, $result->getImpurePoints());
5805-
$isAlwaysTerminating = $isAlwaysTerminating || $result->isAlwaysTerminating();
5805+
$isAlwaysTerminating = $result->isAlwaysTerminating();
58065806
$scope = $result->getScope();
58075807
foreach ($var->items as $i => $arrayItem) {
58085808
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)