Skip to content

Commit

Permalink
#24746 added code improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
Vaha committed Oct 8, 2019
1 parent 3846ddd commit bff0d38
Showing 1 changed file with 45 additions and 45 deletions.
90 changes: 45 additions & 45 deletions app/code/Magento/Sales/Model/Order.php
Original file line number Diff line number Diff line change
Expand Up @@ -1514,7 +1514,7 @@ public function getItemById($itemId)
* Get item by quote item id
*
* @param mixed $quoteItemId
* @return \Magento\Framework\DataObject|null
* @return \Magento\Framework\DataObject|null
*/
public function getItemByQuoteItemId($quoteItemId)
{
Expand Down Expand Up @@ -1976,7 +1976,7 @@ public function getRelatedObjects()
*
* @return string
*/
public function getCustomerName(): string
public function getCustomerName()
{
if (null === $this->getCustomerFirstname()) {
return (string)__('Guest');
Expand All @@ -1998,49 +1998,6 @@ public function getCustomerName(): string
return $customerName;
}

/**
* Is visible customer middlename
*
* @return bool
*/
private function isVisibleCustomerMiddlename(): bool
{
return $this->scopeConfig->isSetFlag(
'customer/address/middlename_show',
ScopeInterface::SCOPE_STORE
);
}

/**
* Is visible customer prefix
*
* @return bool
*/
private function isVisibleCustomerPrefix(): bool
{
$prefixShowValue = $this->scopeConfig->getValue(
'customer/address/prefix_show',
ScopeInterface::SCOPE_STORE
);

return $prefixShowValue !== Nooptreq::VALUE_NO;
}

/**
* Is visible customer suffix
*
* @return bool
*/
private function isVisibleCustomerSuffix(): bool
{
$prefixShowValue = $this->scopeConfig->getValue(
'customer/address/suffix_show',
ScopeInterface::SCOPE_STORE
);

return $prefixShowValue !== Nooptreq::VALUE_NO;
}

/**
* Add New object to related array
*
Expand Down Expand Up @@ -4600,5 +4557,48 @@ public function setShippingMethod($shippingMethod)
return $this->setData('shipping_method', $shippingMethod);
}

/**
* Is visible customer middlename
*
* @return bool
*/
private function isVisibleCustomerMiddlename(): bool
{
return $this->scopeConfig->isSetFlag(
'customer/address/middlename_show',
ScopeInterface::SCOPE_STORE
);
}

/**
* Is visible customer prefix
*
* @return bool
*/
private function isVisibleCustomerPrefix(): bool
{
$prefixShowValue = $this->scopeConfig->getValue(
'customer/address/prefix_show',
ScopeInterface::SCOPE_STORE
);

return $prefixShowValue !== Nooptreq::VALUE_NO;
}

/**
* Is visible customer suffix
*
* @return bool
*/
private function isVisibleCustomerSuffix(): bool
{
$prefixShowValue = $this->scopeConfig->getValue(
'customer/address/suffix_show',
ScopeInterface::SCOPE_STORE
);

return $prefixShowValue !== Nooptreq::VALUE_NO;
}

//@codeCoverageIgnoreEnd
}

0 comments on commit bff0d38

Please sign in to comment.