Skip to content

Commit 404156e

Browse files
committed
10765 code refactoring
1 parent 51e41ac commit 404156e

File tree

1 file changed

+7
-5
lines changed
  • app/code/Magento/Customer/Ui/Component/DataProvider

1 file changed

+7
-5
lines changed

app/code/Magento/Customer/Ui/Component/DataProvider/Document.php

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
use Magento\Framework\App\Config\ScopeConfigInterface;
1212
use Magento\Framework\Exception\NoSuchEntityException;
1313
use Magento\Customer\Api\GroupRepositoryInterface;
14+
use Magento\Framework\App\ObjectManager;
1415
use Magento\Store\Model\ScopeInterface;
1516
use Magento\Store\Model\StoreManagerInterface;
1617

@@ -82,13 +83,13 @@ public function __construct(
8283
GroupRepositoryInterface $groupRepository,
8384
CustomerMetadataInterface $customerMetadata,
8485
StoreManagerInterface $storeManager,
85-
ScopeConfigInterface $scopeConfig
86+
ScopeConfigInterface $scopeConfig = null
8687
) {
8788
parent::__construct($attributeValueFactory);
8889
$this->customerMetadata = $customerMetadata;
8990
$this->groupRepository = $groupRepository;
9091
$this->storeManager = $storeManager;
91-
$this->scopeConfig = $scopeConfig;
92+
$this->scopeConfig = $scopeConfig ? $scopeConfig : ObjectManager::getInstance()->create(ScopeConfigInterface::class);
9293
}
9394

9495
/**
@@ -182,9 +183,10 @@ private function setConfirmationValue()
182183
ScopeInterface::SCOPE_WEBSITES,
183184
$websiteId);
184185

185-
$valueText = !$isConfirmationRequired ?
186-
__('Confirmation Not Required')
187-
: ($value === null ? __('Confirmed') : __('Confirmation Required'));
186+
$valueText = __('Confirmation Not Required');
187+
if ($isConfirmationRequired) {
188+
$valueText = $value === null ? __('Confirmed') : __('Confirmation Required');
189+
}
188190

189191
$this->setCustomAttribute(self::$confirmationAttributeCode, $valueText);
190192
}

0 commit comments

Comments
 (0)