Change record status: 
Project: 
Introduced in branch: 
10.0.x
Introduced in version: 
10.0.0
Description: 

In preparation to adopt Symfony 6.1, the signature of a number of methods that extend from its Serializer component were adjusted to be forward compatible to changes that will be forced in Symfony 7.

The change include stricter typehinting and addition of a $context argument.

The methods changed were:

Drupal\jsonapi\Normalizer\EntityDenormalizerBase::supportsNormalization()
Drupal\jsonapi\Normalizer\ResourceObjectNormalizer::supportsDenormalization()
Drupal\jsonapi\Serializer\Serializer::supportsNormalization()
Drupal\jsonapi\Serializer\Serializer::supportsDenormalization()
Drupal\serialization\Encoder\JsonEncoder::supportsEncoding()
Drupal\serialization\Encoder\JsonEncoder::supportsDecoding()
Drupal\serialization\Encoder\XmlEncoder::supportsEncoding()
Drupal\serialization\Encoder\XmlEncoder::supportsDecoding()
Drupal\serialization\Normalizer\NormalizerBase::supportsNormalization()
Drupal\serialization\Normalizer\NormalizerBase::supportsDenormalization()
Drupal\serialization_test\SerializationTestEncoder::supportsEncoding()
Drupal\serialization_test\SerializationTestNormalizer::supportsNormalization()

The typical change was:

-  public function supportsNormalization($data, $format = NULL): bool {
+  public function supportsNormalization($data, string $format = NULL, array $context = []): bool {

Contrib and custom modules that extend these methods should be changed to abide to the new signature.

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.

Impacts: 
Module developers