Skip to content

Commit d103c6d

Browse files
peter17staabm
authored andcommitted
Attempt to improve performance.
1 parent fa676d1 commit d103c6d

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

‎src/Analyser/NodeScopeResolver.php‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2371,6 +2371,11 @@ public function processStmtNode(
23712371

23722372
// emit error
23732373
foreach ($matchingCatchTypes as $catchTypeIndex => $matched) {
2374+
// Matched (non-dead) catches only need to be reported to the rule
2375+
// when in a trait, to detect disagreement between the classes using it.
2376+
if ($matched && !$scope->isInTrait()) {
2377+
continue;
2378+
}
23742379
$this->callNodeCallback($nodeCallback, new CatchWithUnthrownExceptionNode($catchNode, $catchTypes[$catchTypeIndex], $originalCatchTypes[$catchTypeIndex], $matched), $scope, $storage);
23752380
}
23762381

0 commit comments

Comments
 (0)