Skip to content

Commit c537128

Browse files
authored
Merge branch refs/heads/2.1.x into 2.2.x
2 parents ceec281 + bb5214c commit c537128

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/Analyser/NodeScopeResolver.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1887,8 +1887,13 @@ private function processStmtNode(
18871887
foreach ($stmt->catches as $catchNode) {
18881888
$this->callNodeCallback($nodeCallback, $catchNode, $scope, $storage);
18891889

1890-
$originalCatchTypes = array_map(static fn (Name $name): Type => new ObjectType($name->toString()), $catchNode->types);
1891-
$catchTypes = array_map(static fn (Type $type): Type => TypeCombinator::remove($type, $pastCatchTypes), $originalCatchTypes);
1890+
$originalCatchTypes = [];
1891+
$catchTypes = [];
1892+
foreach ($catchNode->types as $catchNodeType) {
1893+
$catchType = new ObjectType($catchNodeType->toString());
1894+
$originalCatchTypes[] = $catchType;
1895+
$catchTypes[] = TypeCombinator::remove($catchType, $pastCatchTypes);
1896+
}
18921897

18931898
$originalCatchType = TypeCombinator::union(...$originalCatchTypes);
18941899
$catchType = TypeCombinator::union(...$catchTypes);

0 commit comments

Comments
 (0)