From 4a5d9fd18df169bd199e2b512629c0f2138d0648 Mon Sep 17 00:00:00 2001 From: roadiz-ci Date: Fri, 2 Feb 2024 13:35:24 +0000 Subject: [PATCH] chore: Address deprecation on AbstractPathNormalizer --- .../Normalizer/AbstractPathNormalizer.php | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/src/Serializer/Normalizer/AbstractPathNormalizer.php b/src/Serializer/Normalizer/AbstractPathNormalizer.php index e66fb474..e279056f 100644 --- a/src/Serializer/Normalizer/AbstractPathNormalizer.php +++ b/src/Serializer/Normalizer/AbstractPathNormalizer.php @@ -5,13 +5,12 @@ namespace RZ\Roadiz\CoreBundle\Serializer\Normalizer; use Symfony\Component\Routing\Generator\UrlGeneratorInterface; -use Symfony\Component\Serializer\Normalizer\ContextAwareNormalizerInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; use Symfony\Component\Serializer\SerializerAwareInterface; use Symfony\Component\Serializer\SerializerInterface; -abstract class AbstractPathNormalizer implements ContextAwareNormalizerInterface, DenormalizerInterface, SerializerAwareInterface +abstract class AbstractPathNormalizer implements NormalizerInterface, DenormalizerInterface, SerializerAwareInterface { protected UrlGeneratorInterface $urlGenerator; /** @@ -29,27 +28,27 @@ public function __construct(NormalizerInterface $decorated, UrlGeneratorInterfac $this->urlGenerator = $urlGenerator; } - public function supportsNormalization($data, $format = null, array $context = []): bool + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool { - return $this->decorated->supportsNormalization($data, $format); + return $this->decorated->supportsNormalization($data, $format/*, $context*/); } - public function supportsDenormalization($data, $type, $format = null): bool + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool { - return $this->decorated->supportsDenormalization($data, $type, $format); + return $this->decorated->supportsDenormalization($data, $type, $format/*, $context*/); } /** * @param mixed $data - * @param string $class + * @param string $type * @param string|null $format * @param array $context * @return mixed * @throws \Symfony\Component\Serializer\Exception\ExceptionInterface */ - public function denormalize($data, $class, $format = null, array $context = []) + public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed { - return $this->decorated->denormalize($data, $class, $format, $context); + return $this->decorated->denormalize($data, $type, $format, $context); } public function setSerializer(SerializerInterface $serializer): void