Skip to content

Commit 02697d6

Browse files
committed
[Serializer] Looking for DiscriminatorMap on interfaces when the current object also extends from a class
1 parent b1521f3 commit 02697d6

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/Symfony/Component/Serializer/Mapping/ClassDiscriminatorFromClassMetadata.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,9 @@ private function resolveMappingForMappedObject(object|string $object)
7878
{
7979
$reflectionClass = new \ReflectionClass($object);
8080
if ($parentClass = $reflectionClass->getParentClass()) {
81-
return $this->getMappingForMappedObject($parentClass->getName());
81+
if (null !== ($parentMapping = $this->getMappingForMappedObject($parentClass->getName()))) {
82+
return $parentMapping;
83+
}
8284
}
8385

8486
foreach ($reflectionClass->getInterfaceNames() as $interfaceName) {

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy