From b173e2015c89a849aaecc9d8a83e3be6079f7204 Mon Sep 17 00:00:00 2001 From: soyuka Date: Mon, 7 Oct 2024 12:07:20 +0200 Subject: [PATCH] temp --- src/Metadata/ApiProperty.php | 4 ++-- src/Metadata/Tests/Extractor/Adapter/XmlPropertyAdapter.php | 2 +- src/Serializer/Mapping/Loader/PropertyMetadataLoader.php | 3 ++- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/Metadata/ApiProperty.php b/src/Metadata/ApiProperty.php index c554f4f156..cc360503e7 100644 --- a/src/Metadata/ApiProperty.php +++ b/src/Metadata/ApiProperty.php @@ -47,7 +47,7 @@ final class ApiProperty * @param Type[] $builtinTypes * @param string|null $uriTemplate (experimental) whether to return the subRessource collection IRI instead of an iterable of IRI * @param string|null $property The property name - * @param array $serialize + * @param array $serialize */ public function __construct( private ?string $description = null, @@ -615,7 +615,7 @@ public function getSerialize(): ?array } /** - * @param array $serialize + * @param array $serialize */ public function withSerialize(array $serialize): static { diff --git a/src/Metadata/Tests/Extractor/Adapter/XmlPropertyAdapter.php b/src/Metadata/Tests/Extractor/Adapter/XmlPropertyAdapter.php index 6488b99061..1839594d2e 100644 --- a/src/Metadata/Tests/Extractor/Adapter/XmlPropertyAdapter.php +++ b/src/Metadata/Tests/Extractor/Adapter/XmlPropertyAdapter.php @@ -47,7 +47,7 @@ final class XmlPropertyAdapter implements PropertyAdapterInterface 'property', ]; - # Laravel only, we don't need xml support + // Laravel only, we don't need XML support private const EXCLUDE = ['policy', 'serialize']; /** diff --git a/src/Serializer/Mapping/Loader/PropertyMetadataLoader.php b/src/Serializer/Mapping/Loader/PropertyMetadataLoader.php index 505f5009f5..c63114cc3a 100644 --- a/src/Serializer/Mapping/Loader/PropertyMetadataLoader.php +++ b/src/Serializer/Mapping/Loader/PropertyMetadataLoader.php @@ -46,7 +46,7 @@ public function loadClassMetadata(ClassMetadataInterface $classMetadata): bool $classGroups = []; $classContextAnnotation = null; - // It's very weird to grab an eloquent's properties in that case as they're never serialized + // It's very weird to grab Eloquent's properties in that case as they're never serialized // the Serializer makes a call on the abstract class, let's save some unneeded work with a condition if (Model::class === $classMetadata->getName()) { return false; @@ -109,6 +109,7 @@ public function loadClassMetadata(ClassMetadataInterface $classMetadata): bool continue; } + // This code is adapted from Symfony\Component\Serializer\Mapping\Loader\AttributeLoader foreach ($attributes[$propertyName] as $attr) { if ($attr instanceof Groups) { foreach ($attr->getGroups() as $group) {