Fixed some serializer deprecations

This commit is contained in:
Jan Böhmer 2023-06-11 18:12:22 +02:00
parent 219b57a362
commit e57d6e508a
7 changed files with 51 additions and 27 deletions

View file

@ -21,13 +21,12 @@
namespace App\Serializer;
use Brick\Math\BigNumber;
use Symfony\Component\Serializer\Normalizer\CacheableSupportsMethodInterface;
use Symfony\Component\Serializer\Normalizer\NormalizerInterface;
/**
* @see \App\Tests\Serializer\BigNumberNormalizerTest
*/
class BigNumberNormalizer implements NormalizerInterface, CacheableSupportsMethodInterface
class BigNumberNormalizer implements NormalizerInterface
{
public function supportsNormalization($data, string $format = null, array $context = []): bool
@ -44,8 +43,10 @@ class BigNumberNormalizer implements NormalizerInterface, CacheableSupportsMetho
return (string) $object;
}
public function hasCacheableSupportsMethod(): bool
public function getSupportedTypes(?string $format)
{
return true;
return [
BigNumber::class => true,
];
}
}