Skip to content

Commit 666e612

Browse files
committed
fix string interpolation
1 parent 7ff7678 commit 666e612

File tree

3 files changed

+13
-0
lines changed

3 files changed

+13
-0
lines changed

src/Analyser/NodeScopeResolver.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3211,6 +3211,7 @@ static function (): void {
32113211
$hasYield = $hasYield || $result->hasYield();
32123212
$throwPoints = array_merge($throwPoints, $result->getThrowPoints());
32133213
$impurePoints = array_merge($impurePoints, $result->getImpurePoints());
3214+
$isAlwaysTerminating = $isAlwaysTerminating || $result->isAlwaysTerminating();
32143215
$scope = $result->getScope();
32153216
}
32163217
} elseif ($expr instanceof ArrayDimFetch) {

tests/PHPStan/Rules/DeadCode/UnreachableStatementRuleTest.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,10 @@ public function testBug13232a(): void
261261
'Unreachable statement - code above always terminates.',
262262
11,
263263
],
264+
[
265+
'Unreachable statement - code above always terminates.',
266+
17,
267+
],
264268
]);
265269
}
266270

tests/PHPStan/Rules/DeadCode/data/bug-13232a.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,14 @@ public function sayHi(): void
1010
. ' no way';
1111
echo 'this will never happen';
1212
}
13+
14+
public function sayHo(): void
15+
{
16+
echo "Hello, {$this->neverReturnsMethod()} no way";
17+
echo 'this will never happen';
18+
}
19+
20+
function neverReturnsMethod(): never {}
1321
}
1422
function neverReturns(): never {}
1523

0 commit comments

Comments
 (0)