Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Symfony Serializer Deprecation Warnings #415

Merged
merged 1 commit into from
Jun 10, 2023

Conversation

damiantw
Copy link
Contributor

@damiantw damiantw commented Jun 9, 2023

Symfony serializer 6.3 triggers a deprecation error when a normalizer does not define a getSupportedTypes method or when a call is made to hasCacheableSupportsMethod on a Symfony provided normalizer.

symfony/serializer@6.2...v6.3.0#diff-06572a96a58dc510037d5efa622f9bec8519bc1beab13c9f251e97e657a9d4edR13

symfony/serializer@6.2...v6.3.0#diff-51c0e7020499be2a667ccb570a642fca293da2451cca31cec2ecc467ecf58b51R37

symfony/serializer@6.2...v6.3.0#diff-05d8706b90462cdef57865a942e5a6a6bbb87924ee9830fb94555a6022607d73R63

Examples:

ErrorException: Since symfony/serializer 6.3: "Spatie\EventSourcing\Support\CarbonNormalizer" should implement "NormalizerInterface::getSupportedTypes(?string $format): array". in /var/task/vendor/symfony/deprecation-contracts/function.php:25 Stack trace: #0
ErrorException: Since symfony/serializer 6.3: "Spatie\EventSourcing\Support\ModelIdentifierNormalizer" should implement "DenormalizerInterface::getSupportedTypes(?string $format): array". in /var/task/vendor/symfony/deprecation-contracts/function.php:25 Stack trace: #0
ErrorException: Since symfony/serializer 6.3: The "Symfony\Component\Serializer\Normalizer\ObjectNormalizer::hasCacheableSupportsMethod()" method is deprecated, use "getSupportedTypes()" instead. in /var/task/vendor/symfony/deprecation-contracts/function.php:25 Stack trace: #0

This PR prevents these deprecation warnings.

@freekmurze freekmurze merged commit 4014414 into spatie:main Jun 10, 2023
@freekmurze
Copy link
Member

Thank you!

@damiantw damiantw deleted the serializer-deprecation-fix branch June 10, 2023 13:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants