Skip to content

Commit

Permalink
Fix RethrowExceptionRule
Browse files Browse the repository at this point in the history
  • Loading branch information
ondrejmirtes committed Sep 4, 2024
1 parent 72b9205 commit 93a4f02
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/Rule/Nette/RethrowExceptionRule.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,13 @@ public function processNode(Node $node, Scope $scope): array
}
if (
count($catch->stmts) === 1
&& $catch->stmts[0] instanceof Node\Stmt\Throw_
&& $catch->stmts[0]->expr instanceof Variable
&& $catch->stmts[0] instanceof Node\Stmt\Expression
&& $catch->stmts[0]->expr instanceof Node\Expr\Throw_
&& $catch->stmts[0]->expr->expr instanceof Variable
&& $catch->var !== null
&& is_string($catch->var->name)
&& is_string($catch->stmts[0]->expr->name)
&& $catch->var->name === $catch->stmts[0]->expr->name
&& is_string($catch->stmts[0]->expr->expr->name)
&& $catch->var->name === $catch->stmts[0]->expr->expr->name
) {
continue 2;
}
Expand Down

0 comments on commit 93a4f02

Please sign in to comment.