Skip to content

Commit 148777c

Browse files
authored
Merge pull request #31 from assoconnect/jwa_fix_symfony7
Update AbsoluteDateNormalizer.php
2 parents dd96ed5 + 992c191 commit 148777c

1 file changed

Lines changed: 7 additions & 6 deletions

File tree

src/Normalizer/AbsoluteDateNormalizer.php

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,14 @@
77
use AssoConnect\PHPDate\AbsoluteDate;
88
use Symfony\Component\Serializer\Exception\InvalidArgumentException;
99
use Symfony\Component\Serializer\Exception\NotNormalizableValueException;
10-
use Symfony\Component\Serializer\Normalizer\CacheableSupportsMethodInterface;
1110
use Symfony\Component\Serializer\Normalizer\DenormalizerInterface;
1211
use 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

Comments
 (0)