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 ApiPlatform deprecations #3674

Merged
merged 4 commits into from
Aug 14, 2023

Conversation

BacLuc
Copy link
Contributor

@BacLuc BacLuc commented Aug 6, 2023

TranslationConstraintViolationListNormalizer: switch to getSupportedTypes

CacheableSupportsMethodInterface is deprecated.

fixes:
   1x: Class "App\Serializer\Normalizer\TranslationConstraintViolationListNormalizer" should implement method "Symfony\Component\Serializer\Normalizer\NormalizerInterface::getSupportedTypes(?string $format): array".
    1x in CreateActivityTest::testCreateActivityIsDeniedForAnonymousUser from App\Tests\Api\Activities

UriTemplateNormalizer: switch to getSupportedTypes

CacheableSupportsMethodInterface is deprecated.

fixes:
   1x: Class "App\Serializer\Normalizer\UriTemplateNormalizer" should implement method "Symfony\Component\Serializer\Normalizer\NormalizerInterface::getSupportedTypes(?string $format): array".
    1x in CreateActivityTest::testCreateActivityIsDeniedForAnonymousUser from App\Tests\Api\Activities

  1x: The "App\Serializer\Normalizer\UriTemplateNormalizer" class implements "Symfony\Component\Serializer\Normalizer\CacheableSupportsMethodInterface" that is deprecated since Symfony 6.3, implement "getSupportedTypes(?string $format)" instead.
    1x in CreateActivityTest::testCreateActivityIsDeniedForAnonymousUser from App\Tests\Api\Activities

api/Denormalizer: implement getSupportedTypes

Because we want to call these Denormalizers only ones per request,
we cannot cache the result of supportsDenormalization.

fixes:
  1x: Class "App\Serializer\Denormalizer\InputFilterDenormalizer" should implement method "Symfony\Component\Serializer\Normalizer\DenormalizerInterface::getSupportedTypes(?string $format): array".
    1x in CreateActivityTest::testCreateActivityIsDeniedForAnonymousUser from App\Tests\Api\Activities

  1x: Class "App\Serializer\Denormalizer\MaterialItemDenormalizer" should implement method "Symfony\Component\Serializer\Normalizer\DenormalizerInterface::getSupportedTypes(?string $format): array".
    1x in CreateActivityTest::testCreateActivityIsDeniedForAnonymousUser from App\Tests\Api\Activities

api/Normalizer: implement getSupportedTypes

These Normalizers did not implement the CacheableSupportsMethodInterface
but decorate Normalizers which might support caching the
result of supportsNormalization.
Because the method implementation is not yet enforced,
we have to check if the method exists on the decorated Normalizer.

fixes:
  1x: Class "App\Serializer\Normalizer\CollectionItemsNormalizer" should implement method "Symfony\Component\Serializer\Normalizer\NormalizerInterface::getSupportedTypes(?string $format): array".
    1x in CreateActivityTest::testCreateActivityIsDeniedForAnonymousUser from App\Tests\Api\Activities

  1x: Class "App\Serializer\Normalizer\ContentTypeNormalizer" should implement method "Symfony\Component\Serializer\Normalizer\NormalizerInterface::getSupportedTypes(?string $format): array".
    1x in CreateActivityTest::testCreateActivityIsDeniedForAnonymousUser from App\Tests\Api\Activities

  1x: Class "App\Serializer\Normalizer\RelatedCollectionLinkNormalizer" should implement method "Symfony\Component\Serializer\Normalizer\NormalizerInterface::getSupportedTypes(?string $format): array".
    1x in CreateActivityTest::testCreateActivityIsDeniedForAnonymousUser from App\Tests\Api\Activities

…ypes

CacheableSupportsMethodInterface is deprecated.

fixes:
   1x: Class "App\Serializer\Normalizer\TranslationConstraintViolationListNormalizer" should implement method "Symfony\Component\Serializer\Normalizer\NormalizerInterface::getSupportedTypes(?string $format): array".
    1x in CreateActivityTest::testCreateActivityIsDeniedForAnonymousUser from App\Tests\Api\Activities
CacheableSupportsMethodInterface is deprecated.

fixes:
   1x: Class "App\Serializer\Normalizer\UriTemplateNormalizer" should implement method "Symfony\Component\Serializer\Normalizer\NormalizerInterface::getSupportedTypes(?string $format): array".
    1x in CreateActivityTest::testCreateActivityIsDeniedForAnonymousUser from App\Tests\Api\Activities

  1x: The "App\Serializer\Normalizer\UriTemplateNormalizer" class implements "Symfony\Component\Serializer\Normalizer\CacheableSupportsMethodInterface" that is deprecated since Symfony 6.3, implement "getSupportedTypes(?string $format)" instead.
    1x in CreateActivityTest::testCreateActivityIsDeniedForAnonymousUser from App\Tests\Api\Activities
Because we want to call these Denormalizers only ones per request,
we cannot cache the result of supportsDenormalization.

fixes:
  1x: Class "App\Serializer\Denormalizer\InputFilterDenormalizer" should implement method "Symfony\Component\Serializer\Normalizer\DenormalizerInterface::getSupportedTypes(?string $format): array".
    1x in CreateActivityTest::testCreateActivityIsDeniedForAnonymousUser from App\Tests\Api\Activities

  1x: Class "App\Serializer\Denormalizer\MaterialItemDenormalizer" should implement method "Symfony\Component\Serializer\Normalizer\DenormalizerInterface::getSupportedTypes(?string $format): array".
    1x in CreateActivityTest::testCreateActivityIsDeniedForAnonymousUser from App\Tests\Api\Activities
These Normalizers did not implement the CacheableSupportsMethodInterface
but decorate Normalizers which might support caching the
result of supportsNormalization.
Because the method implementation is not yet enforced,
we have to check if the method exists on the decorated Normalizer.

fixes:
  1x: Class "App\Serializer\Normalizer\CollectionItemsNormalizer" should implement method "Symfony\Component\Serializer\Normalizer\NormalizerInterface::getSupportedTypes(?string $format): array".
    1x in CreateActivityTest::testCreateActivityIsDeniedForAnonymousUser from App\Tests\Api\Activities

  1x: Class "App\Serializer\Normalizer\ContentTypeNormalizer" should implement method "Symfony\Component\Serializer\Normalizer\NormalizerInterface::getSupportedTypes(?string $format): array".
    1x in CreateActivityTest::testCreateActivityIsDeniedForAnonymousUser from App\Tests\Api\Activities

  1x: Class "App\Serializer\Normalizer\RelatedCollectionLinkNormalizer" should implement method "Symfony\Component\Serializer\Normalizer\NormalizerInterface::getSupportedTypes(?string $format): array".
    1x in CreateActivityTest::testCreateActivityIsDeniedForAnonymousUser from App\Tests\Api\Activities
@carlobeltrame carlobeltrame merged commit 4292a9f into ecamp:devel Aug 14, 2023
19 of 21 checks passed
@BacLuc BacLuc deleted the api-platform-deprecations branch August 14, 2023 10:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

3 participants