Skip to content

Commit fce3afe

Browse files
committed
7241 Revert commit eb79b38 and re-add constants
See #11462 (comment)
1 parent eb79b38 commit fce3afe

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

app/code/Magento/Config/Model/Config/Source/Nooptreq.php

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,19 @@
1111
*/
1212
class Nooptreq implements \Magento\Framework\Option\ArrayInterface
1313
{
14+
const VALUE_NO = '';
15+
const VALUE_OPTIONAL = 'opt';
16+
const VALUE_REQUIRED = 'req';
17+
1418
/**
1519
* @return array
1620
*/
1721
public function toOptionArray()
1822
{
1923
return [
20-
['value' => '', 'label' => __('No')],
21-
['value' => 'opt', 'label' => __('Optional')],
22-
['value' => 'req', 'label' => __('Required')]
24+
['value' => self::VALUE_NO, 'label' => __('No')],
25+
['value' => self::VALUE_OPTIONAL, 'label' => __('Optional')],
26+
['value' => self::VALUE_REQUIRED, 'label' => __('Required')]
2327
];
2428
}
2529
}

app/code/Magento/Customer/Model/Options.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public function getNamePrefixOptions($store = null)
4545
{
4646
return $this->prepareNamePrefixSuffixOptions(
4747
$this->addressHelper->getConfig('prefix_options', $store),
48-
$this->addressHelper->getConfig('prefix_show', $store) == 'opt'
48+
$this->addressHelper->getConfig('prefix_show', $store) == NooptreqSource::VALUE_OPTIONAL
4949
);
5050
}
5151

@@ -59,7 +59,7 @@ public function getNameSuffixOptions($store = null)
5959
{
6060
return $this->prepareNamePrefixSuffixOptions(
6161
$this->addressHelper->getConfig('suffix_options', $store),
62-
$this->addressHelper->getConfig('suffix_show', $store) == 'opt'
62+
$this->addressHelper->getConfig('suffix_show', $store) == NooptreqSource::VALUE_OPTIONAL
6363
);
6464
}
6565

0 commit comments

Comments
 (0)