Skip to content

Commit

Permalink
10765 code refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
Zefiryn committed Sep 17, 2017
1 parent 51e41ac commit 404156e
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions app/code/Magento/Customer/Ui/Component/DataProvider/Document.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
use Magento\Framework\App\Config\ScopeConfigInterface;
use Magento\Framework\Exception\NoSuchEntityException;
use Magento\Customer\Api\GroupRepositoryInterface;
use Magento\Framework\App\ObjectManager;
use Magento\Store\Model\ScopeInterface;
use Magento\Store\Model\StoreManagerInterface;

Expand Down Expand Up @@ -82,13 +83,13 @@ public function __construct(
GroupRepositoryInterface $groupRepository,
CustomerMetadataInterface $customerMetadata,
StoreManagerInterface $storeManager,
ScopeConfigInterface $scopeConfig
ScopeConfigInterface $scopeConfig = null
) {
parent::__construct($attributeValueFactory);
$this->customerMetadata = $customerMetadata;
$this->groupRepository = $groupRepository;
$this->storeManager = $storeManager;
$this->scopeConfig = $scopeConfig;
$this->scopeConfig = $scopeConfig ? $scopeConfig : ObjectManager::getInstance()->create(ScopeConfigInterface::class);
}

/**
Expand Down Expand Up @@ -182,9 +183,10 @@ private function setConfirmationValue()
ScopeInterface::SCOPE_WEBSITES,
$websiteId);

$valueText = !$isConfirmationRequired ?
__('Confirmation Not Required')
: ($value === null ? __('Confirmed') : __('Confirmation Required'));
$valueText = __('Confirmation Not Required');
if ($isConfirmationRequired) {
$valueText = $value === null ? __('Confirmed') : __('Confirmation Required');
}

$this->setCustomAttribute(self::$confirmationAttributeCode, $valueText);
}
Expand Down

0 comments on commit 404156e

Please sign in to comment.