Skip to content

Commit

Permalink
Fix NodeVisitor for "covered only" mode for multi line nodes
Browse files Browse the repository at this point in the history
  • Loading branch information
gehrisandro committed Feb 6, 2024
1 parent d914395 commit d328931
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Support/NodeVisitor.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public function leaveNode(Node $node): Node|int|null
return null;
}

if ($this->linesToMutate !== [] && ! in_array($node->getStartLine(), $this->linesToMutate, true)) {
if ($this->linesToMutate !== [] && array_filter(range($node->getStartLine(), $node->getEndLine()), fn (int $line): bool => in_array($line, $this->linesToMutate, true)) === []) {
return null;
}

Expand Down

0 comments on commit d328931

Please sign in to comment.