@@ -124,20 +124,20 @@ |
||
124 | 124 | */ |
125 | 125 | private function denormalizeObject(array $data, string $class, $format = null, array $context = []) |
126 | 126 | { |
127 | - // Try to denormalize in other normalizers. Necessary to avoid cycle |
|
128 | - $context[self::WONT_DENORMALIZE] = true; |
|
129 | - if (\is_object($denormalizedValue = $this->serializer->denormalize($data, $class, $format, $context))) { |
|
130 | - return $denormalizedValue; |
|
131 | - } |
|
127 | + // Try to denormalize in other normalizers. Necessary to avoid cycle |
|
128 | + $context[self::WONT_DENORMALIZE] = true; |
|
129 | + if (\is_object($denormalizedValue = $this->serializer->denormalize($data, $class, $format, $context))) { |
|
130 | + return $denormalizedValue; |
|
131 | + } |
|
132 | 132 | |
133 | - // Denormalize in current default normalizer |
|
134 | - unset($context[self::WONT_DENORMALIZE]); |
|
133 | + // Denormalize in current default normalizer |
|
134 | + unset($context[self::WONT_DENORMALIZE]); |
|
135 | 135 | |
136 | - foreach ($data as $key => $value) { |
|
137 | - $data[$key] = $this->denormalizeValue($value, $class, $format, $context); |
|
138 | - } |
|
136 | + foreach ($data as $key => $value) { |
|
137 | + $data[$key] = $this->denormalizeValue($value, $class, $format, $context); |
|
138 | + } |
|
139 | 139 | |
140 | - return $this->objectNormalizer->denormalize($data, $class, $format, $context); |
|
140 | + return $this->objectNormalizer->denormalize($data, $class, $format, $context); |
|
141 | 141 | } |
142 | 142 | |
143 | 143 | /** |