From 80943bea4c172229b89afd41541853e71dba46fa Mon Sep 17 00:00:00 2001 From: sviatoslav-lashkiv Date: Wed, 19 May 2021 11:14:03 +0300 Subject: [PATCH 1/2] Update Status model in Sales module Minor fix for unused constant instead of duplicated text --- app/code/Magento/Sales/Model/Config/Source/Order/Status.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Sales/Model/Config/Source/Order/Status.php b/app/code/Magento/Sales/Model/Config/Source/Order/Status.php index 80daf4707279b..872f05eb393ff 100644 --- a/app/code/Magento/Sales/Model/Config/Source/Order/Status.php +++ b/app/code/Magento/Sales/Model/Config/Source/Order/Status.php @@ -52,7 +52,7 @@ public function toOptionArray() ? $this->_orderConfig->getStateStatuses($this->_stateStatuses) : $this->_orderConfig->getStatuses(); - $options = [['value' => '', 'label' => __('-- Please Select --')]]; + $options = [['value' => '', 'label' => __(self::UNDEFINED_OPTION_LABEL)]]; foreach ($statuses as $code => $label) { $options[] = ['value' => $code, 'label' => $label]; } From 457c92d752baf5bb9c4bdb08144e4cc684a87255 Mon Sep 17 00:00:00 2001 From: T Prasanna Date: Fri, 18 Oct 2024 18:27:20 +0530 Subject: [PATCH 2/2] fix static test --- .../Magento/Sales/Model/Config/Source/Order/Status.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/app/code/Magento/Sales/Model/Config/Source/Order/Status.php b/app/code/Magento/Sales/Model/Config/Source/Order/Status.php index 872f05eb393ff..f31d769fc6d71 100644 --- a/app/code/Magento/Sales/Model/Config/Source/Order/Status.php +++ b/app/code/Magento/Sales/Model/Config/Source/Order/Status.php @@ -10,13 +10,13 @@ namespace Magento\Sales\Model\Config\Source\Order; /** - * Class Status + * Provides a list of order statuses * @api * @since 100.0.2 */ class Status implements \Magento\Framework\Option\ArrayInterface { - const UNDEFINED_OPTION_LABEL = '-- Please Select --'; + public const UNDEFINED_OPTION_LABEL = '-- Please Select --'; /** * @var string[] @@ -44,6 +44,8 @@ public function __construct(\Magento\Sales\Model\Order\Config $orderConfig) } /** + * Returns a list of order statuses + * * @return array */ public function toOptionArray() @@ -52,7 +54,8 @@ public function toOptionArray() ? $this->_orderConfig->getStateStatuses($this->_stateStatuses) : $this->_orderConfig->getStatuses(); - $options = [['value' => '', 'label' => __(self::UNDEFINED_OPTION_LABEL)]]; + $undefinedOptionLabel = self::UNDEFINED_OPTION_LABEL; + $options = [['value' => '', 'label' => __($undefinedOptionLabel)]]; foreach ($statuses as $code => $label) { $options[] = ['value' => $code, 'label' => $label]; }