Skip to content

[Serializer] Serializer class wrongly implements Normalizer interface - incorrect name of param $data (should be $object) #61051

@Pechynho

Description

@Pechynho

Symfony version(s) affected

6.4

Description

Hi,

I've noticed that Symfony Serializer class wrongly implements Normalizer interface. It uses different name for first argument - should be $object and its called $data. This makes using Serializer with named arguments impossible.

Serializer: https://github.com/symfony/serializer/blob/6.4/Serializer.php#L157
Normalizer interface: https://github.com/symfony/serializer/blob/6.4/Normalizer/NormalizerInterface.php#L41

How to reproduce

This code is causing error:

$this->serializer->normalize(object: $object)

Possible Solution

No response

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions