8000 [Serializer] Cannot use @Context context in AdvancedNameConverterInte… · symfony/symfony@c99082c · GitHub
[go: up one dir, main page]

Skip to content

Commit c99082c

Browse files
committed
[Serializer] Cannot use @context context in AdvancedNameConverterInterface::denormalize
1 parent 4675b31 commit c99082c

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

src/Symfony/Component/Serializer/CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
CHANGELOG
22
=========
33

4+
6.2
5+
---
6+
7+
* Add support for constructor promoted properties to `Context` attribute
8+
49
6.1
510
---
611

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -334,8 +334,8 @@ protected function instantiateObject(array &$data, string $class, array &$contex
334334
$params = [];
335335
foreach ($constructorParameters as $constructorParameter) {
336336
$paramName = $constructorParameter->name;
337-
$attributeContext = $this->getAttributeDenormalizationContext($class, $paramName, $context);
338-
$key = $this->nameConverter ? $this->nameConverter->normalize($paramName, $class, $format, $attributeContext) : $paramName;
337+
$key = $this->nameConverter ? $this->nameConverter->normalize($paramName, $class, $format, $context) : $paramName;
338+
$attributeContext = $this->getAttributeDenormalizationContext($class, $key, $context);
339339

340340
$allowed = false === $allowedAttributes || \in_array($paramName, $allowedAttributes);
341341
$ignored = !$this->isAllowedAttribute($class, $paramName, $format, $context);

0 commit comments

Comments
 (0)
0