diff --git a/app/code/Magento/Sales/Model/Order/Creditmemo.php b/app/code/Magento/Sales/Model/Order/Creditmemo.php index e276eccb85b5a..823385c4b78d7 100644 --- a/app/code/Magento/Sales/Model/Order/Creditmemo.php +++ b/app/code/Magento/Sales/Model/Order/Creditmemo.php @@ -439,14 +439,14 @@ public function canVoid() */ public static function getStates() { - if (is_null(self::$_states)) { - self::$_states = [ + if (is_null(static::$_states)) { + static::$_states = [ self::STATE_OPEN => __('Pending'), self::STATE_REFUNDED => __('Refunded'), self::STATE_CANCELED => __('Canceled'), ]; } - return self::$_states; + return static::$_states; } /** @@ -461,11 +461,11 @@ public function getStateName($stateId = null) $stateId = $this->getState(); } - if (is_null(self::$_states)) { - self::getStates(); + if (is_null(static::$_states)) { + static::getStates(); } - if (isset(self::$_states[$stateId])) { - return self::$_states[$stateId]; + if (isset(static::$_states[$stateId])) { + return static::$_states[$stateId]; } return __('Unknown State'); } diff --git a/app/code/Magento/Sales/Model/Order/Invoice.php b/app/code/Magento/Sales/Model/Order/Invoice.php index 8b9fb91513250..622bc7783c119 100644 --- a/app/code/Magento/Sales/Model/Order/Invoice.php +++ b/app/code/Magento/Sales/Model/Order/Invoice.php @@ -543,14 +543,14 @@ public function addItem(\Magento\Sales\Model\Order\Invoice\Item $item) */ public static function getStates() { - if (null === self::$_states) { - self::$_states = [ + if (null === static::$_states) { + static::$_states = [ self::STATE_OPEN => __('Pending'), self::STATE_PAID => __('Paid'), self::STATE_CANCELED => __('Canceled'), ]; } - return self::$_states; + return static::$_states; } /** @@ -565,11 +565,11 @@ public function getStateName($stateId = null) $stateId = $this->getState(); } - if (null === self::$_states) { - self::getStates(); + if (null === static::$_states) { + static::getStates(); } - if (isset(self::$_states[$stateId])) { - return self::$_states[$stateId]; + if (isset(static::$_states[$stateId])) { + return static::$_states[$stateId]; } return __('Unknown State'); }