Skip to content

Commit 9b718c5

Browse files
committed
fix not smart enough type checker
1 parent aa64d0d commit 9b718c5

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/StaticAnalysis/ExecutableLinesFindingVisitor.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -239,9 +239,12 @@ private function getLines(NodeAbstract $node, bool $fromReturns): array
239239
if ($node instanceof If_ ||
240240
$node instanceof ElseIf_ ||
241241
$node instanceof While_ ||
242-
$node instanceof Do_ ||
243-
$node instanceof Case_) {
244-
if ($node instanceof Case_ && null === $node->cond) {
242+
$node instanceof Do_) {
243+
return [$this->getNodeStartLine($node->cond)];
244+
}
245+
246+
if ($node instanceof Case_) {
247+
if (null === $node->cond) {
245248
return [];
246249
}
247250

0 commit comments

Comments
 (0)