Skip to content

Commit c210d2b

Browse files
committed
prevent failures around not existing TypeInfo classes
Having a getType() method on an extractor is not enough. Such a method may exist to be forward-compatible with the TypeInfo component. We still must not call it if the TypeInfo component is not installed to prevent running into errors for not-defined classes when the TypeInfo component is not installed.
1 parent 6066de1 commit c210d2b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Diff for: Normalizer/AbstractObjectNormalizer.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -938,7 +938,7 @@ private function getType(string $currentClass, string $attribute): Type|array|nu
938938
*/
939939
private function getPropertyType(string $className, string $property): Type|array|null
940940
{
941-
if (method_exists($this->propertyTypeExtractor, 'getType')) {
941+
if (class_exists(Type::class) && method_exists($this->propertyTypeExtractor, 'getType')) {
942942
return $this->propertyTypeExtractor->getType($className, $property);
943943
}
944944

0 commit comments

Comments
 (0)