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 7bd4ac5

Browse filesBrowse files
committed
Test
1 parent d9f1a72 commit 7bd4ac5
Copy full SHA for 7bd4ac5

File tree

1 file changed

+7
-3
lines changed
Filter options

1 file changed

+7
-3
lines changed

‎src/Symfony/Component/Serializer/Normalizer/AbstractNormalizer.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Serializer/Normalizer/AbstractNormalizer.php
+7-3Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -319,9 +319,13 @@ protected function instantiateObject(array &$data, $class, array &$context, \Ref
319319
$params = array_merge($params, $data[$paramName]);
320320
}
321321
} elseif ($allowed && !$ignored && (isset($data[$key]) || array_key_exists($key, $data))) {
322-
$params[] = $data[$key];
323-
// don't run set for a parameter passed to the constructor
324-
unset($data[$key]);
322+
$parameterData = $data[$key];
323+
if (null !== $constructogrParameter->getClass()) {
324+
$parameterData = $this->serializer->denormalize($parameterData, $constructorParameter->getClass()->getName(), null, $context);
325+
}
326+
327+
// Don't run set for a parameter passed to the constructor
328+
$params[] = $parameterData;
325329
} elseif ($constructorParameter->isDefaultValueAvailable()) {
326330
$params[] = $constructorParameter->getDefaultValue();
327331
} else {

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.