-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Replace erroneous usage of unsData method #18814
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
Replace erroneous usage of unsData method #18814
Conversation
Hi @t-richards. Thank you for your contribution
For more details, please, review the Magento Contributor Assistant documentation |
@t-richards nice catch! Need to check if there are similar occurrences in non-public code. |
@orlangur Probably it makes sense to add some logic which checks if |
@orlangur and I see no reason on holding this PR on since it is a fix anyway :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No such occurrences in B2B/EE code.
@slavvka I would rather throw an |
Hi @orlangur, thank you for the review. |
Hi @t-richards. Thank you for your contribution. |
Description (*)
This pull request replaces incorrect usages of the magic
unsData
method. Note that there is nothing inherently wrong with magic methods likeunsData()
, but calling theuns
orhas
variants with any arguments is a mistake.For example,
The above statement is functionally equivalent to the following code:
Since the
unsData
method is being called with an argument, it is almost certainly the case that the original author(s) intended to use theunsetData
method instead.Fixed Issues (if relevant)
N/A
Manual testing scenarios (*)
Contribution checklist (*)