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 83bd108

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

File tree

Expand file treeCollapse file tree

1 file changed

+3
-1
lines changed
Filter options
Expand file treeCollapse file tree

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
@@ -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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.