Skip to content

Commit c5727bb

Browse files
authored
ENGCOM-3941: [Backport] Added constants to unit codes to make it easier to reuse it if necessary #20505
2 parents 5d7e9d2 + db128bf commit c5727bb

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

app/code/Magento/Directory/Model/Config/Source/WeightUnit.php

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
* Copyright © Magento, Inc. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6+
67
namespace Magento\Directory\Model\Config\Source;
78

89
/**
@@ -14,10 +15,23 @@
1415
class WeightUnit implements \Magento\Framework\Option\ArrayInterface
1516
{
1617
/**
17-
* {@inheritdoc}
18+
* @var string
19+
*/
20+
const CODE_LBS = 'lbs';
21+
22+
/**
23+
* @var string
24+
*/
25+
const CODE_KGS = 'kgs';
26+
27+
/**
28+
* @inheritdoc
1829
*/
1930
public function toOptionArray()
2031
{
21-
return [['value' => 'lbs', 'label' => __('lbs')], ['value' => 'kgs', 'label' => __('kgs')]];
32+
return [
33+
['value' => self::CODE_LBS, 'label' => __('lbs')],
34+
['value' => self::CODE_KGS, 'label' => __('kgs')]
35+
];
2236
}
2337
}

0 commit comments

Comments
 (0)