From 432a515ad676750324d4eae02619654a96fdd344 Mon Sep 17 00:00:00 2001 From: soyuka Date: Thu, 6 Feb 2025 10:29:00 +0100 Subject: [PATCH] fix(metadata): remove temporary fix for ArrayCollection --- .../Factory/PropertyInfoPropertyMetadataFactory.php | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/src/Metadata/Property/Factory/PropertyInfoPropertyMetadataFactory.php b/src/Metadata/Property/Factory/PropertyInfoPropertyMetadataFactory.php index c15072345d8..e0db3e48d8b 100644 --- a/src/Metadata/Property/Factory/PropertyInfoPropertyMetadataFactory.php +++ b/src/Metadata/Property/Factory/PropertyInfoPropertyMetadataFactory.php @@ -15,9 +15,7 @@ use ApiPlatform\Metadata\ApiProperty; use ApiPlatform\Metadata\Exception\PropertyNotFoundException; -use Doctrine\Common\Collections\ArrayCollection; use Symfony\Component\PropertyInfo\PropertyInfoExtractorInterface; -use Symfony\Component\PropertyInfo\Type; /** * PropertyInfo metadata loader decorator. @@ -46,16 +44,7 @@ public function create(string $resourceClass, string $property, array $options = } if (!$propertyMetadata->getBuiltinTypes()) { - $types = $this->propertyInfo->getTypes($resourceClass, $property, $options) ?? []; - - foreach ($types as $i => $type) { - // Temp fix for https://github.com/symfony/symfony/pull/52699 - if (ArrayCollection::class === $type->getClassName()) { - $types[$i] = new Type($type->getBuiltinType(), $type->isNullable(), $type->getClassName(), true, $type->getCollectionKeyTypes(), $type->getCollectionValueTypes()); - } - } - - $propertyMetadata = $propertyMetadata->withBuiltinTypes($types); + $propertyMetadata = $propertyMetadata->withBuiltinTypes($this->propertyInfo->getTypes($resourceClass, $property, $options) ?? []); } if (null === $propertyMetadata->getDescription() && null !== $description = $this->propertyInfo->getShortDescription($resourceClass, $property, $options)) {