File tree Expand file tree Collapse file tree 1 file changed +14
-10
lines changed Expand file tree Collapse file tree 1 file changed +14
-10
lines changed Original file line number Diff line number Diff line change @@ -273,18 +273,22 @@ public static function getPropertyTypeForColumn(string $columnType): ?string
273
273
default => null ,
274
274
};
275
275
276
- if (null === $ propertyType && Type::getTypeRegistry ()->has ($ columnType )) {
277
- $ reflection = new \ReflectionClass (\get_class (Type::getTypeRegistry ()->get ($ columnType )));
278
- if ($ reflection ->hasMethod ('convertToPHPValue ' ) && $ returnType = $ reflection ->getMethod ('convertToPHPValue ' )->getReturnType ()) {
279
- if ($ returnType ->isBuiltin ()) {
280
- $ propertyType = $ returnType ->getName ();
281
- } else {
282
- $ propertyType = '\\' .$ returnType ->getName ();
283
- }
284
- }
276
+ if (null !== $ propertyType || !($ registry = Type::getTypeRegistry ())->has ($ columnType )) {
277
+ return $ propertyType ;
278
+ }
279
+
280
+ $ reflection = new \ReflectionClass (($ registry ->get ($ columnType ))::class);
281
+
282
+ $ returnType = $ reflection ->getMethod ('convertToPHPValue ' )->getReturnType ();
283
+
284
+ /*
285
+ * we do not support union and intersection types
286
+ */
287
+ if (!$ returnType instanceof \ReflectionNamedType) {
288
+ return null ;
285
289
}
286
290
287
- return $ propertyType ;
291
+ return $ returnType -> isBuiltin () ? $ returnType -> getName () : '\\' . $ returnType -> getName () ;
288
292
}
289
293
290
294
/**
You can’t perform that action at this time.
0 commit comments