From 7d8256689220ad920c551876910930cfbe1976a7 Mon Sep 17 00:00:00 2001 From: David Moulton Date: Thu, 19 Dec 2024 11:27:27 +0000 Subject: [PATCH] Make elifeAssessment term properties more explicitly truthful to the schema https://github.com/elifesciences/issues/issues/9034 --- src/Serializer/ElifeAssessmentNormalizer.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Serializer/ElifeAssessmentNormalizer.php b/src/Serializer/ElifeAssessmentNormalizer.php index e06c0d55..08ca98f7 100644 --- a/src/Serializer/ElifeAssessmentNormalizer.php +++ b/src/Serializer/ElifeAssessmentNormalizer.php @@ -13,7 +13,9 @@ final class ElifeAssessmentNormalizer implements NormalizerInterface, Denormaliz public function denormalize($data, $class, $format = null, array $context = []) : ElifeAssessment { - return new ElifeAssessment($data['significance'], $data['strength']); + $significance = $data['significance'] ?? null; + $strength = $data['strength'] ?? null; + return new ElifeAssessment($significance, $strength); } public function supportsDenormalization($data, $type, $format = null) : bool