Skip to content

Commit 3eb8af3

Browse files
committed
feat(mapper): safe match
1 parent 431ab3f commit 3eb8af3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/mapper/src/CasterFactory.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ public function forProperty(PropertyReflector $property): ?Caster
6969
public function forType(TypeReflector $type): ?Caster
7070
{
7171
foreach ($this->casters as [$for, $casterClass]) {
72-
if (is_string($for) && $type->matches($for) && ! \is_callable($for)) {
72+
if (is_string($for) && $type->matches($for) && is_string($casterClass)) {
7373
return get($casterClass);
7474
}
7575
}

0 commit comments

Comments
 (0)