-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Closed
Labels
Issue: Clear DescriptionGate 2 Passed. Manual verification of the issue description passedGate 2 Passed. Manual verification of the issue description passedIssue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedIssue: Format is validGate 1 Passed. Automatic verification of issue format passedGate 1 Passed. Automatic verification of issue format passednon-issue
Description
If you get the customer from the session and then get the group id, the group id is returned as a string. The return type for that function specifies it should be of type int but it is returning as a string.
Preconditions
- Magento 2.1.12
- PHP 7.0.27
- MySQL 5.7.21
Steps to reproduce
$customer = $this->customerSession->getCustomer();
$groupId = $customer->getGroupId();
Expected result
$groupId
should be of type int and not a string.
Actual result
$groupId
is returned as a string instead of an int as the function phpDoc specifies.
/**
* Retrieve customer group identifier
*
* @return int
*/
public function getGroupId()
{
if (!$this->hasData('group_id')) {
$storeId = $this->getStoreId() ? $this->getStoreId() : $this->_storeManager->getStore()->getId();
$groupId = $this->_scopeConfig->getValue(
GroupManagement::XML_PATH_DEFAULT_ID,
ScopeInterface::SCOPE_STORE,
$storeId
);
$this->setData('group_id', $groupId);
}
return $this->getData('group_id');
}
Metadata
Metadata
Assignees
Labels
Issue: Clear DescriptionGate 2 Passed. Manual verification of the issue description passedGate 2 Passed. Manual verification of the issue description passedIssue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedIssue: Format is validGate 1 Passed. Automatic verification of issue format passedGate 1 Passed. Automatic verification of issue format passednon-issue