Skip to content

Commit d05dd53

Browse files
committed
Fix
1 parent c24d2bb commit d05dd53

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

Diff for: src/Rule/Nette/RethrowExceptionRule.php

+3-2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
use PhpParser\Node;
66
use PhpParser\Node\Expr\Variable;
7+
use PhpParser\Node\Name;
78
use PhpParser\Node\Stmt\TryCatch;
89
use PHPStan\Analyser\Scope;
910
use PHPStan\Type\ObjectType;
@@ -56,8 +57,8 @@ public function processNode(Node $node, Scope $scope): array
5657
foreach ($exceptions as $exceptionName) {
5758
$exceptionType = new ObjectType($exceptionName);
5859
foreach ($node->catches as $catch) {
59-
$caughtType = TypeCombinator::union(...array_map(function (string $class): ObjectType {
60-
return new ObjectType($class);
60+
$caughtType = TypeCombinator::union(...array_map(function (Name $class): ObjectType {
61+
return new ObjectType((string) $class);
6162
}, $catch->types));
6263
if (!$caughtType->isSuperTypeOf($exceptionType)->yes()) {
6364
continue;

0 commit comments

Comments
 (0)