Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 02697d6

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

File tree

1 file changed

+3
-1
lines changed
Filter options

1 file changed

+3
-1
lines changed

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

Copy file name to clipboardExpand all lines: src/Symfony/Component/Serializer/Mapping/ClassDiscriminatorFromClassMetadata.php
+3-1Lines 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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.