Skip to content

Commit 83bd108

Browse files
committed
[Serializer] Looking for DiscriminatorMap on interfaces when the current object also extends from a class
1 parent 521d210 commit 83bd108

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
@@ -69,7 +69,9 @@ private function resolveMappingForMappedObject(object|string $object)
6969
{
7070
$reflectionClass = new \ReflectionClass($object);
7171
if ($parentClass = $reflectionClass->getParentClass()) {
72-
return $this->getMappingForMappedObject($parentClass->getName());
72+
if (null !== ($parentMapping = $this->getMappingForMappedObject($parentClass->getName()))) {
73+
return $parentMapping;
74+
}
7375
}
7476

7577
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