Skip to content

Commit

Permalink
Use static:: instead of self:: to support late static bindings
Browse files Browse the repository at this point in the history
  • Loading branch information
jokeputs committed May 31, 2017
1 parent 137022f commit 1c51b54
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
14 changes: 7 additions & 7 deletions app/code/Magento/Sales/Model/Order/Creditmemo.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

/**
Expand All @@ -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');
}
Expand Down
14 changes: 7 additions & 7 deletions app/code/Magento/Sales/Model/Order/Invoice.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

/**
Expand All @@ -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');
}
Expand Down

0 comments on commit 1c51b54

Please sign in to comment.