Skip to content

Commit eef7083

Browse files
committed
mapper: fix possible crash when mapper type is not single TypeWithClassName
1 parent 7e9ad3a commit eef7083

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/Types/MapperMethodReturnTypeExtension.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,10 @@ public function getTypeFromMethodCall(
6363
): Type
6464
{
6565
$mapper = $scope->getType($methodCall->var);
66-
\assert($mapper instanceof TypeWithClassName);
6766

6867
$defaultReturn = ParametersAcceptorSelector::selectSingle($methodReflection->getVariants())->getReturnType();
6968

70-
if ($mapper->getClassName() === DbalMapper::class) {
69+
if (!$mapper instanceof TypeWithClassName || $mapper->getClassName() === DbalMapper::class) {
7170
return $defaultReturn;
7271
}
7372

0 commit comments

Comments
 (0)