NormalizerBase::supportsNormalization incompatible with NormalizerInterface::supportsNormalization($data, $format = null)

Created on 1 February 2024, 7 months ago

After upgrade our site to Drupal 10.2.2, Error comes:

Fatal error: Declaration of Drupal\serialization\Normalizer\NormalizerBase::supportsNormalization($data, ?string $format = null, array $context = []): bool must be compatible with Symfony\Component\Serializer\Normalizer\NormalizerInterface::supportsNormalization($data, $format = null) in /var/www/html/docroot/core/modules/serialization/src/Normalizer/NormalizerBase.php on line 26

Drupal10.2.2 will install symfony/serializer: 6.4.2
https://github.com/symfony/serializer/blob/6.4/Normalizer/NormalizerInte...

    public function supportsNormalization(mixed $data, ?string $format = null /* , array $context = [] */);

It's not campatible with https://git.drupalcode.org/project/drupal/-/blob/10.2.2/core/modules/ser...

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

Let's see symfony/serializer: 7.0 https://github.com/symfony/serializer/blob/7.0/Normalizer/NormalizerInte...
It will compatible with Drupal10.2.2

🐛 Bug report
Status

Closed: works as designed

Version

10.2

Component
Serialization 

Last updated 18 days ago

Created by

🇨🇳China lawxen

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024