Skip to content

Commit 1c51b54

Browse files
committed
Use static:: instead of self:: to support late static bindings
1 parent 137022f commit 1c51b54

File tree

2 files changed

+14
-14
lines changed

2 files changed

+14
-14
lines changed

app/code/Magento/Sales/Model/Order/Creditmemo.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -439,14 +439,14 @@ public function canVoid()
439439
*/
440440
public static function getStates()
441441
{
442-
if (is_null(self::$_states)) {
443-
self::$_states = [
442+
if (is_null(static::$_states)) {
443+
static::$_states = [
444444
self::STATE_OPEN => __('Pending'),
445445
self::STATE_REFUNDED => __('Refunded'),
446446
self::STATE_CANCELED => __('Canceled'),
447447
];
448448
}
449-
return self::$_states;
449+
return static::$_states;
450450
}
451451

452452
/**
@@ -461,11 +461,11 @@ public function getStateName($stateId = null)
461461
$stateId = $this->getState();
462462
}
463463

464-
if (is_null(self::$_states)) {
465-
self::getStates();
464+
if (is_null(static::$_states)) {
465+
static::getStates();
466466
}
467-
if (isset(self::$_states[$stateId])) {
468-
return self::$_states[$stateId];
467+
if (isset(static::$_states[$stateId])) {
468+
return static::$_states[$stateId];
469469
}
470470
return __('Unknown State');
471471
}

app/code/Magento/Sales/Model/Order/Invoice.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -543,14 +543,14 @@ public function addItem(\Magento\Sales\Model\Order\Invoice\Item $item)
543543
*/
544544
public static function getStates()
545545
{
546-
if (null === self::$_states) {
547-
self::$_states = [
546+
if (null === static::$_states) {
547+
static::$_states = [
548548
self::STATE_OPEN => __('Pending'),
549549
self::STATE_PAID => __('Paid'),
550550
self::STATE_CANCELED => __('Canceled'),
551551
];
552552
}
553-
return self::$_states;
553+
return static::$_states;
554554
}
555555

556556
/**
@@ -565,11 +565,11 @@ public function getStateName($stateId = null)
565565
$stateId = $this->getState();
566566
}
567567

568-
if (null === self::$_states) {
569-
self::getStates();
568+
if (null === static::$_states) {
569+
static::getStates();
570570
}
571-
if (isset(self::$_states[$stateId])) {
572-
return self::$_states[$stateId];
571+
if (isset(static::$_states[$stateId])) {
572+
return static::$_states[$stateId];
573573
}
574574
return __('Unknown State');
575575
}

0 commit comments

Comments
 (0)