From 48563f08c3226209840c1c7463922a71eac97246 Mon Sep 17 00:00:00 2001 From: Nathan Date: Fri, 30 Sep 2022 08:57:12 +0200 Subject: [PATCH 1/2] Fix deprecation in TraceableMetadataFactory https://github.com/schmittjoh/JMSSerializerBundle/issues/907 --- Debug/TraceableMetadataFactory.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Debug/TraceableMetadataFactory.php b/Debug/TraceableMetadataFactory.php index f5d2f69e..76f7876b 100644 --- a/Debug/TraceableMetadataFactory.php +++ b/Debug/TraceableMetadataFactory.php @@ -3,7 +3,9 @@ namespace JMS\SerializerBundle\Debug; use Metadata\AdvancedMetadataFactoryInterface; +use Metadata\ClassHierarchyMetadata; use Metadata\ClassMetadata; +use Metadata\MergeableClassMetadata; /** * @internal @@ -32,7 +34,7 @@ public function getAllClassNames(): array return $this->metadataFactory->getAllClassNames(); } - public function getMetadataForClass(string $className) + public function getMetadataForClass(string $className): ClassHierarchyMetadata|MergeableClassMetadata|null { $metadata = $this->metadataFactory->getMetadataForClass($className); if ($metadata instanceof ClassMetadata) { From e87bb9f6169bebfac7dd994e85ab19dc9c4dba1e Mon Sep 17 00:00:00 2001 From: Nathan Date: Sun, 30 Oct 2022 15:39:16 +0100 Subject: [PATCH 2/2] fix for php7 --- Debug/TraceableMetadataFactory.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Debug/TraceableMetadataFactory.php b/Debug/TraceableMetadataFactory.php index 76f7876b..5b0a6d86 100644 --- a/Debug/TraceableMetadataFactory.php +++ b/Debug/TraceableMetadataFactory.php @@ -34,7 +34,10 @@ public function getAllClassNames(): array return $this->metadataFactory->getAllClassNames(); } - public function getMetadataForClass(string $className): ClassHierarchyMetadata|MergeableClassMetadata|null + /** + * @return ClassHierarchyMetadata|MergeableClassMetadata|null + */ + public function getMetadataForClass(string $className) { $metadata = $this->metadataFactory->getMetadataForClass($className); if ($metadata instanceof ClassMetadata) {