77use AssoConnect \PHPDate \AbsoluteDate ;
88use Symfony \Component \Serializer \Exception \InvalidArgumentException ;
99use Symfony \Component \Serializer \Exception \NotNormalizableValueException ;
10- use Symfony \Component \Serializer \Normalizer \CacheableSupportsMethodInterface ;
1110use Symfony \Component \Serializer \Normalizer \DenormalizerInterface ;
1211use Symfony \Component \Serializer \Normalizer \NormalizerInterface ;
1312
1413/**
1514 * Normalizes an instance of {@see AbsoluteDate} to a date string.
1615 * Denormalizes a date string to an instance of {@see AbsoluteDate}.
1716 */
18- class AbsoluteDateNormalizer implements NormalizerInterface, DenormalizerInterface, CacheableSupportsMethodInterface
17+ class AbsoluteDateNormalizer implements NormalizerInterface, DenormalizerInterface
1918{
2019 public const FORMAT_KEY = 'datetime_format ' ;
2120
@@ -42,7 +41,7 @@ public function normalize($object, string $format = null, array $context = []):
4241 /**
4342 * {@inheritdoc}
4443 */
45- public function supportsNormalization ($ data , string $ format = null ): bool
44+ public function supportsNormalization (mixed $ data , string $ format = null , array $ context = [] ): bool
4645 {
4746 return $ data instanceof AbsoluteDate;
4847 }
@@ -67,13 +66,15 @@ public function denormalize($data, string $type, string $format = null, array $c
6766 /**
6867 * {@inheritdoc}
6968 */
70- public function supportsDenormalization ($ data , string $ type , string $ format = null ): bool
69+ public function supportsDenormalization (mixed $ data , string $ type , ? string $ format = null , array $ content = [] ): bool
7170 {
7271 return AbsoluteDate::class === $ type ;
7372 }
7473
75- public function hasCacheableSupportsMethod ( ): bool
74+ public function getSupportedTypes (? string $ format ): array
7675 {
77- return __CLASS__ === \get_class ($ this );
76+ return [
77+ get_class ($ this ) => true ,
78+ ];
7879 }
7980}
0 commit comments