Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 291123

Symfony\Component\Serializer\Normalizer\NormalizerInterface::supportsEncoding/supportsDecoding will require a new "array $context" argument in the next major version

$
0
0

Problem/Motivation

From #3275864: [META] Symfony 6.1 compatibility.

Full test results: https://www.drupal.org/pift-ci-job/2364329

  1x: The "Drupal\serialization\Normalizer\NormalizerBase::supportsNormalization()" method will require a new "array $context" argument in the next major version of its interface "Symfony\Component\Serializer\Normalizer\NormalizerInterface", not defining it is deprecated.
    1x in HttpExceptionNormalizerTest::testNormalize from Drupal\Tests\jsonapi\Unit\Normalizer
1	

  1x: The "Drupal\serialization\Encoder\JsonEncoder::supportsDecoding()" method will require a new "array $context" argument in the next major version of its parent class 

Looks like we need to change the following:

modules/jsonapi/src/Normalizer/EntityDenormalizerBase.php
modules/jsonapi/src/Serializer/Serializer.php
modules/serialization/tests/serialization_test/src/SerializationTestNormalizer.php
modules/serialization/src/Normalizer/NormalizerBase.php

Steps to reproduce

Proposed resolution

Add the new argument to all core classes implementing the interface in 10.x

Contrib modules that also implement the interface will be able to add the extra argument in 9.4.x for forward compatibility because PHP allows adding extra arguments to interface methods in implementing classes, so this shouldn't require separate 9.4.x and 10.0.x branches.

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

Code that extends Symfony's Serializer component has been updated with stricter typehints and an additional argument for compatibility with Symfony 6.1 and future releases. For more information, review the change record: Context argument added in code that extends from Symfony's Serializer component.


Viewing all articles
Browse latest Browse all 291123

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>