From d5b07bbaa39e40a0534653917d6b11b458251038 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20B=C3=B6hmer?= Date: Sun, 3 Mar 2024 18:55:50 +0100 Subject: [PATCH] Added additional type hints --- .../APIPlatform/DetermineTypeFromElementIRIDenormalizer.php | 2 +- src/Serializer/APIPlatform/OverrideClassDenormalizer.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Serializer/APIPlatform/DetermineTypeFromElementIRIDenormalizer.php b/src/Serializer/APIPlatform/DetermineTypeFromElementIRIDenormalizer.php index c2c33f6b..46291fe0 100644 --- a/src/Serializer/APIPlatform/DetermineTypeFromElementIRIDenormalizer.php +++ b/src/Serializer/APIPlatform/DetermineTypeFromElementIRIDenormalizer.php @@ -101,7 +101,7 @@ class DetermineTypeFromElementIRIDenormalizer implements DenormalizerInterface, return $this->denormalizer->denormalize($data, $type, $format, $context); } - public function supportsDenormalization(mixed $data, string $type, ?string $format = null, array $context = []) + public function supportsDenormalization(mixed $data, string $type, ?string $format = null, array $context = []): bool { //Only denormalize if the _type discriminator is not set and the class is supported and we not have already called this function return !isset($context[self::ALREADY_CALLED]) diff --git a/src/Serializer/APIPlatform/OverrideClassDenormalizer.php b/src/Serializer/APIPlatform/OverrideClassDenormalizer.php index f3458a5b..c8155abc 100644 --- a/src/Serializer/APIPlatform/OverrideClassDenormalizer.php +++ b/src/Serializer/APIPlatform/OverrideClassDenormalizer.php @@ -38,7 +38,7 @@ class OverrideClassDenormalizer implements DenormalizerInterface, DenormalizerAw public const CONTEXT_KEY = '__override_type__'; - public function denormalize(mixed $data, string $type, ?string $format = null, array $context = []) + public function denormalize(mixed $data, string $type, ?string $format = null, array $context = []): mixed { //Deserialize the data with the overridden type $overrideType = $context[self::CONTEXT_KEY];