Skip to content

Commit

Permalink
[BUGFIX] Skip Exceptions without any parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
simonschaufi committed Oct 15, 2024
1 parent acef332 commit 55978e8
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,6 @@ private function shouldSkip(Throw_ $node): bool
return true;
}

return count($node->expr->args) > 1;
return count($node->expr->args) !== 1;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ if ('a' === 'b') {
throw new \RuntimeException('my message');
}

if ('b' === 'c') {
throw new \RuntimeException();
}

throw new \RuntimeException('do not touch this', 564);
?>
-----
Expand All @@ -17,5 +21,9 @@ if ('a' === 'b') {
throw new \RuntimeException('my message', 1729021897);
}

if ('b' === 'c') {
throw new \RuntimeException();
}

throw new \RuntimeException('do not touch this', 564);
?>

0 comments on commit 55978e8

Please sign in to comment.