CsvEncoder::encode must be compatible with Symfony\Component\Serializer\Encoder\EncoderInterface::encode

Created on 23 February 2023, almost 2 years ago
Updated 5 March 2024, 10 months ago

Problem/Motivation

While running the 3.x branch on Drupal 9, the following error is encountered:

Fatal error: Declaration of Drupal\csv_serialization\Encoder\CsvEncoder::encode($data, string $format, array $context = Array): string must be compatible with Symfony\Component\Serializer\Encoder\EncoderInterface::encode($data, $format, array $context = Array) in /var/lib/tugboat/stm/web/modules/contrib/csv_serialization/src/Encoder/CsvEncoder.php on line 125

This is due to the difference in EncoderInterface::encode() signatures between Symfony 4.4 (D9) and Symfony 6.2 (D10).

Proposed resolution

Is there a way to support both or do we need to drop support for Drupal 9 on the 3.x branch?

🐛 Bug report
Status

Fixed

Version

3.0

Component

Code

Created by

🇺🇸United States markdorison

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

Comments & Activities

Production build 0.71.5 2024