-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
Type cast Ids from String
to Integer
#14057
Conversation
@@ -886,7 +886,7 @@ public function getGroupId() | |||
ScopeInterface::SCOPE_STORE, | |||
$storeId | |||
); | |||
$this->setData('group_id', $groupId); | |||
$this->setData('group_id', (int)$groupId); | |||
} | |||
return $this->getData('group_id'); |
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.
Why haven't you changed added casting from string to int here?
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.
I'm not getting you, will you please elaborate?
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.
@yogeshks he is talking about the return. The return should be type casted.
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.
Hi @ferrazzuk
Thanks for the correction, I'll update my commit accordingly.
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.
@yogeshks can you move the type casting to the return instead?
I don't like the idea of change ID type to IMHO: We should keep PS: You have to keep in mind that change to interface can affect thousands of Magento 2 instances after update. |
@lbajsarowicz I disagree with you for these two reasons:
Its makes sense to keep data type's consistency in this case. |
Hi @ferrazzuk, |
Hi, |
@yogeshks I don't take those decision. I'm just a contributor like you |
Closing PR as mentioned issue is not valid.
Thanks for collaboration @ferrazzuk and @yogeshks! |
The methods
getGroupId
andgetTaxClassId
should set and return the Integer value of Id but they are returning String values.And the method
getSharedWebsiteIds
should return integer type array of website Ids but it's returning the string type array of website Ids.So before setting the value of Ids, I've typecast the value of Id from String to Integer.
Description
Fixed Issues (if relevant)
Manual testing scenarios
N/A
Contribution checklist