[Serializer] Inconsistent Naming of First Argument in normalize() Method between NormalizerInterface and Serializer Class #54774
Labels
Bug
DX
DX = Developer eXperience (anything that improves the experience of using Symfony)
Serializer
Status: Needs Review
Symfony version(s) affected
5.0-7.1
Description
The
normalize()
method in theSymfony\Component\Serializer\Normalizer\NormalizerInterface
interface has the first argument namedobject
, yet in the class implementing this interface,Symfony\Component\Serializer\Serializer
, the first argument is calleddata
. This discrepancy prevents the use of a named argument.Fatal error: Uncaught Error: Unknown named parameter $object
How to reproduce
Possible Solution
Rename first argument of
Symfony\Component\Serializer\Serializer::normalize()
class as described in interfaceAdditional Context
Perhaps it's unlikely that anyone will use the named argument as the first parameter, but it does seem like an inconsistency in implementation, I suppose. Thanks.
The text was updated successfully, but these errors were encountered: