mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-07-07 08:54:36 +02:00
Fixed some serializer deprecations
This commit is contained in:
parent
219b57a362
commit
e57d6e508a
7 changed files with 51 additions and 27 deletions
|
@ -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,
|
||||
];
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue