From bff0d385cfc6138b5a75423498bf9e9a88061d79 Mon Sep 17 00:00:00 2001 From: Vaha Date: Tue, 8 Oct 2019 08:29:28 +0300 Subject: [PATCH] magento/magento2#24746 added code improvements --- app/code/Magento/Sales/Model/Order.php | 90 +++++++++++++------------- 1 file changed, 45 insertions(+), 45 deletions(-) diff --git a/app/code/Magento/Sales/Model/Order.php b/app/code/Magento/Sales/Model/Order.php index 062c51bef9c04..89564f97ccf16 100644 --- a/app/code/Magento/Sales/Model/Order.php +++ b/app/code/Magento/Sales/Model/Order.php @@ -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) { @@ -1976,7 +1976,7 @@ public function getRelatedObjects() * * @return string */ - public function getCustomerName(): string + public function getCustomerName() { if (null === $this->getCustomerFirstname()) { return (string)__('Guest'); @@ -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 * @@ -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 }