New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rename object to data in NormalizerInterface::normalize
#54880
base: 7.2
Are you sure you want to change the base?
Rename object to data in NormalizerInterface::normalize
#54880
Conversation
8440c4a
to
b2e70e5
Compare
I think we'd better not do this: named arguments are out of the BC promise, so using named arguments is a terrible argument for this change :) Also, this interface accepts mixed, not only objects, so $data is a more appropriate name. We might want to change the interface instead. |
I was anticipating a discussion, so I was surprised by the sudden appearance of this PR. I agree, @nicolas-grekas, but would modifying the interface be a BC? |
Yeah i just opened this PR to push the discussion about it because it took just a few seconds to prepare this PR. I'm open to close this PR with "Won't Fix" or even take the topic to change the interface as Nicolas mentioned. And when we want to change it, is it really a bugix or should we do this in 7.2? |
IMO those interface changes are rather BC than changes of implemantation. |
Named arguments out of our BC promise. Also, changing argument names on interfaces cannot break existing code since PHP maps to arguments found in concrete implementations, not in abstract ones. |
That'd be for 7.2, it's not a bug fix but just a tweak. |
b2e70e5
to
7a35fc4
Compare
normalize
to allow named attriburesnormalize
to allow named attribures
normalize
to allow named attriburesnormalize
for type mixed
c669d62
to
6e486bc
Compare
I'd suggest changing only the interface |
Don't we want to keep the other classes in sync with the interface? |
6e486bc
to
ca8f75c
Compare
Renaming all implementations will increase the risk of conflicts when merging between branches. |
ca8f75c
to
a5c4dba
Compare
normalize
for type mixedNormalizerInterface::normalize
…malize`` from object to data because of type mixed
a5c4dba
to
26983eb
Compare
Rename sttribure ofSerializer::normalize
to the naming of the interface to make the usage of named attributes possible.From the discussion of this PR I changed it to rename the first parameter of
NormalizerInterface::normalize
fromobject
todata
because it can't handle only objects, it's typemixed
.