Skip to content

Commit

Permalink
chore: Address deprecation on AbstractPathNormalizer
Browse files Browse the repository at this point in the history
  • Loading branch information
roadiz-ci committed Feb 2, 2024
1 parent 032255f commit 4a5d9fd
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions src/Serializer/Normalizer/AbstractPathNormalizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
/**
Expand All @@ -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
Expand Down

0 comments on commit 4a5d9fd

Please sign in to comment.