From bfeba754d9e1ed708e884e10dd615d288eb1bd02 Mon Sep 17 00:00:00 2001 From: Francis Hilaire Date: Wed, 5 Jun 2024 17:01:40 +0200 Subject: [PATCH] Signature update --- src/Serializer/JsonRpc/JsonRpcDecoder.php | 2 +- src/Serializer/NullOdooRelationDenormalizer.php | 4 ++-- src/Serializer/NullableDateTimeDenormalizer.php | 4 ++-- src/Serializer/OdooRelationDenormalizer.php | 2 +- src/Serializer/OdooRelationNormalizer.php | 2 +- src/Serializer/OdooRelationSingleDenormalizer.php | 2 +- src/Serializer/OdooRelationsDenormalizer.php | 2 +- src/Serializer/OdooRelationsNormalizer.php | 3 +-- src/Serializer/XmlRpc/XmlRpcDecoder.php | 2 +- 9 files changed, 11 insertions(+), 12 deletions(-) diff --git a/src/Serializer/JsonRpc/JsonRpcDecoder.php b/src/Serializer/JsonRpc/JsonRpcDecoder.php index 7bc8a0b..3de4e41 100644 --- a/src/Serializer/JsonRpc/JsonRpcDecoder.php +++ b/src/Serializer/JsonRpc/JsonRpcDecoder.php @@ -33,7 +33,7 @@ public function supportsDecoding($format, array $context = []): bool * * @throws JsonException */ - public function decode($data, $format, array $context = []) + public function decode(string $data, string $format, array $context = []): mixed { if ('' === trim($data)) { throw new UnexpectedValueException('Invalid JSON data, it can not be empty.'); diff --git a/src/Serializer/NullOdooRelationDenormalizer.php b/src/Serializer/NullOdooRelationDenormalizer.php index fa14662..9323464 100644 --- a/src/Serializer/NullOdooRelationDenormalizer.php +++ b/src/Serializer/NullOdooRelationDenormalizer.php @@ -18,7 +18,7 @@ public function getSupportedTypes(?string $format): array return [OdooRelation::class => false]; } - public function supportsDenormalization($data, $type, $format = null): bool + public function supportsDenormalization(mixed $data, string $type, ?string $format = null, array $context = []): bool { if ($type !== OdooRelation::class) { return false; @@ -28,7 +28,7 @@ public function supportsDenormalization($data, $type, $format = null): bool return false === $data; } - public function denormalize($data, $type, $format = null, array $context = []) + public function denormalize(mixed $data, string $type, ?string $format = null, array $context = []): mixed { if (false === $data) { return null; diff --git a/src/Serializer/NullableDateTimeDenormalizer.php b/src/Serializer/NullableDateTimeDenormalizer.php index e4781ee..361a8e2 100644 --- a/src/Serializer/NullableDateTimeDenormalizer.php +++ b/src/Serializer/NullableDateTimeDenormalizer.php @@ -21,12 +21,12 @@ public function getSupportedTypes(?string $format): array ]; } - public function denormalize($data, string $type, string $format = null, array $context = []) + public function denormalize(mixed $data, string $type, ?string $format = null, array $context = []): mixed { return null; } - public function supportsDenormalization($data, string $type, string $format = null): bool + public function supportsDenormalization(mixed $data, string $type, ?string $format = null, array $context = []): bool { if (!\is_string($data) || '' === trim($data)) { return $this->dateTimeNormalizer->supportsDenormalization($data, $type, $format); diff --git a/src/Serializer/OdooRelationDenormalizer.php b/src/Serializer/OdooRelationDenormalizer.php index f40f000..f725dc9 100644 --- a/src/Serializer/OdooRelationDenormalizer.php +++ b/src/Serializer/OdooRelationDenormalizer.php @@ -18,7 +18,7 @@ public function getSupportedTypes(?string $format): array return [OdooRelation::class => false]; } - public function supportsDenormalization($data, $type, $format = null): bool + public function supportsDenormalization(mixed $data, string $type, ?string $format = null, array $context = []): bool { if ($type !== OdooRelation::class) { return false; diff --git a/src/Serializer/OdooRelationNormalizer.php b/src/Serializer/OdooRelationNormalizer.php index df1286a..0d67c20 100644 --- a/src/Serializer/OdooRelationNormalizer.php +++ b/src/Serializer/OdooRelationNormalizer.php @@ -20,7 +20,7 @@ public function getSupportedTypes(?string $format): array return [OdooRelation::class => true]; } - public function supportsNormalization($data, $format = null): bool + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool { return $data instanceof OdooRelation; } diff --git a/src/Serializer/OdooRelationSingleDenormalizer.php b/src/Serializer/OdooRelationSingleDenormalizer.php index 32b43d8..fa8db53 100644 --- a/src/Serializer/OdooRelationSingleDenormalizer.php +++ b/src/Serializer/OdooRelationSingleDenormalizer.php @@ -18,7 +18,7 @@ public function getSupportedTypes(?string $format): array return [OdooRelation::class => false]; } - public function supportsDenormalization($data, $type, $format = null): bool + public function supportsDenormalization(mixed $data, string $type, ?string $format = null, array $context = []): bool { if ($type !== OdooRelation::class) { return false; diff --git a/src/Serializer/OdooRelationsDenormalizer.php b/src/Serializer/OdooRelationsDenormalizer.php index d324b24..838fb96 100644 --- a/src/Serializer/OdooRelationsDenormalizer.php +++ b/src/Serializer/OdooRelationsDenormalizer.php @@ -18,7 +18,7 @@ public function getSupportedTypes(?string $format): array return [OdooRelation::class => false]; } - public function supportsDenormalization($data, $type, $format = null): bool + public function supportsDenormalization(mixed $data, string $type, ?string $format = null, array $context = []): bool { if ($type !== OdooRelation::class) { return false; diff --git a/src/Serializer/OdooRelationsNormalizer.php b/src/Serializer/OdooRelationsNormalizer.php index 40a89d4..3e9a38c 100644 --- a/src/Serializer/OdooRelationsNormalizer.php +++ b/src/Serializer/OdooRelationsNormalizer.php @@ -6,12 +6,11 @@ use FluxSE\OdooApiClient\Model\OdooRelation; use Symfony\Component\Serializer\Exception\NotNormalizableValueException; -use Symfony\Component\Serializer\Normalizer\ContextAwareNormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; -final class OdooRelationsNormalizer implements NormalizerInterface, NormalizerAwareInterface, ContextAwareNormalizerInterface +final class OdooRelationsNormalizer implements NormalizerInterface, NormalizerAwareInterface { use NormalizerAwareTrait; diff --git a/src/Serializer/XmlRpc/XmlRpcDecoder.php b/src/Serializer/XmlRpc/XmlRpcDecoder.php index 439f6ed..ad33556 100644 --- a/src/Serializer/XmlRpc/XmlRpcDecoder.php +++ b/src/Serializer/XmlRpc/XmlRpcDecoder.php @@ -30,7 +30,7 @@ public function supportsDecoding($format, array $context = []): bool /** * @return array|integer|string|boolean */ - public function decode($data, $format, array $context = []) + public function decode(string $data, string $format, array $context = []): mixed { if ('' === trim($data)) { throw new UnexpectedValueException('Invalid XML data, it can not be empty.');