Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 93a4f02

Browse files
Fix RethrowExceptionRule
1 parent 72b9205 commit 93a4f02

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

‎src/Rule/Nette/RethrowExceptionRule.php‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,12 +74,13 @@ public function processNode(Node $node, Scope $scope): array
7474
}
7575
if (
7676
count($catch->stmts) === 1
77-
&& $catch->stmts[0] instanceof Node\Stmt\Throw_
78-
&& $catch->stmts[0]->expr instanceof Variable
77+
&& $catch->stmts[0] instanceof Node\Stmt\Expression
78+
&& $catch->stmts[0]->expr instanceof Node\Expr\Throw_
79+
&& $catch->stmts[0]->expr->expr instanceof Variable
7980
&& $catch->var !== null
8081
&& is_string($catch->var->name)
81-
&& is_string($catch->stmts[0]->expr->name)
82-
&& $catch->var->name === $catch->stmts[0]->expr->name
82+
&& is_string($catch->stmts[0]->expr->expr->name)
83+
&& $catch->var->name === $catch->stmts[0]->expr->expr->name
8384
) {
8485
continue 2;
8586
}

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /