Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed calls to static methods #965

Merged
merged 1 commit into from
May 14, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public function __construct()

public function render(Varien_Object $row)
{
return Mage::helper('customer')->__($this->getStatus($row->getQueueStatus()));
return Mage::helper('customer')->__(self::getStatus($row->getQueueStatus()));
}

public static function getStatus($status)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,11 @@ protected function _getFormat()
$localeData = new Zend_Locale_Data;
switch ($this->getColumn()->getPeriodType()) {
case 'month' :
self::$_format = $localeData->getContent($localeCode, 'dateitem', 'yM');
self::$_format = $localeData::getContent($localeCode, 'dateitem', 'yM');
break;

case 'year' :
self::$_format = $localeData->getContent($localeCode, 'dateitem', 'y');
self::$_format = $localeData::getContent($localeCode, 'dateitem', 'y');
break;

default:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,7 @@ public function generateAction()
}

/** @var $generator Mage_SalesRule_Model_Coupon_Massgenerator */
$generator = $rule->getCouponMassGenerator();
$generator = $rule::getCouponMassGenerator();
if (!$generator->validateData($data)) {
$result['error'] = Mage::helper('salesrule')->__('Not valid data provided');
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ public function getResourcesPermissions()
if (!$resourceUserPrivileges) { // skip user without any privileges for resource
continue;
}
$operations = $operationSource->toArray();
$operations = $operationSource::toArray();

if (empty($resourceUserPrivileges[Mage_Api2_Model_Resource::OPERATION_CREATE])
&& empty($resourceUserPrivileges[Mage_Api2_Model_Resource::OPERATION_UPDATE])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ public function getResourcesPermissions()
$config = Mage::getModel('api2/config');
/** @var $privilegeSource Mage_Api2_Model_Acl_Global_Rule_Privilege */
$privilegeSource = Mage::getModel('api2/acl_global_rule_privilege');
$privileges = array_keys($privilegeSource->toArray());
$privileges = array_keys($privilegeSource::toArray());

/** @var $node Varien_Simplexml_Element */
foreach ($config->getResources() as $resourceType => $node) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ public function getJsonConfig()
$bundlePriceModel->getLowestPrice($currentProduct, $tierPriceInfo['price']);
$tierPriceInfo['website_price'] =
$bundlePriceModel->getLowestPrice($currentProduct, $tierPriceInfo['website_price']);
$tierPriceInfo['price'] = $coreHelper->currency($tierPriceInfo['price'], false, false);
$tierPriceInfo['price'] = $coreHelper::currency($tierPriceInfo['price'], false, false);
$tierPriceInfo['priceInclTax'] = $taxHelper->getPrice(
$_selection,
$tierPriceInfo['price'],
Expand Down Expand Up @@ -250,10 +250,10 @@ public function getJsonConfig()
$selection = array (
'qty' => $_qty,
'customQty' => $_selection->getSelectionCanChangeQty(),
'price' => $coreHelper->currency($_selection->getFinalPrice(), false, false),
'priceInclTax' => $coreHelper->currency($_priceInclTax, false, false),
'priceExclTax' => $coreHelper->currency($_priceExclTax, false, false),
'priceValue' => $coreHelper->currency($_selection->getSelectionPriceValue(), false, false),
'price' => $coreHelper::currency($_selection->getFinalPrice(), false, false),
'priceInclTax' => $coreHelper::currency($_priceInclTax, false, false),
'priceExclTax' => $coreHelper::currency($_priceExclTax, false, false),
'priceValue' => $coreHelper::currency($_selection->getSelectionPriceValue(), false, false),
'priceType' => $_selection->getSelectionPriceType(),
'tierPrice' => $tierPrices,
'name' => $_selection->getName(),
Expand Down Expand Up @@ -295,7 +295,7 @@ public function getJsonConfig()
'selected' => $selected,
'bundleId' => $currentProduct->getId(),
'priceFormat' => Mage::app()->getLocale()->getJsPriceFormat(),
'basePrice' => $coreHelper->currency($currentProduct->getPrice(), false, false),
'basePrice' => $coreHelper::currency($currentProduct->getPrice(), false, false),
'priceType' => $currentProduct->getPriceType(),
'specialPrice' => $currentProduct->getSpecialPrice(),
'includeTax' => Mage::helper('tax')->priceIncludesTax() ? 'true' : 'false',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -280,11 +280,11 @@ public function formatPriceString($price, $includeContainer = true)
$priceTax = $taxHelper->getPrice($product, $price);
$priceIncTax = $taxHelper->getPrice($product, $price, true);

$formated = $coreHelper->currencyByStore($priceTax, $product->getStore(), true, $includeContainer);
$formated = $coreHelper::currencyByStore($priceTax, $product->getStore(), true, $includeContainer);
if ($taxHelper->displayBothPrices() && $priceTax != $priceIncTax) {
$formated .=
' (+' .
$coreHelper->currencyByStore($priceIncTax, $product->getStore(), true, $includeContainer) .
$coreHelper::currencyByStore($priceIncTax, $product->getStore(), true, $includeContainer) .
' ' . $this->__('Incl. Tax') . ')';
}

Expand Down
2 changes: 1 addition & 1 deletion app/code/core/Mage/Catalog/Model/Product/Type/Price.php
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ protected function _getCustomerGroupId($product)
*/
protected function _applySpecialPrice($product, $finalPrice)
{
return $this->calculateSpecialPrice($finalPrice, $product->getSpecialPrice(), $product->getSpecialFromDate(),
return self::calculateSpecialPrice($finalPrice, $product->getSpecialPrice(), $product->getSpecialFromDate(),
$product->getSpecialToDate(), $product->getStore()
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -813,7 +813,7 @@ protected function _getStoreDate($storeId, $date = null)

$dateObj = new Zend_Date(null, null, $locale);
$dateObj->setTimezone($timezone);
$this->_dates[$storeId] = array($dateObj, $locale->getTranslation(null, 'date', $locale));
$this->_dates[$storeId] = array($dateObj, $locale::getTranslation(null, 'date', $locale));
}

if (!is_empty_date($date)) {
Expand Down
2 changes: 1 addition & 1 deletion app/code/core/Mage/Core/Helper/Data.php
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ public static function currencyByStore($value, $store = null, $format = true, $i
*/
public function formatCurrency($value, $includeContainer = true)
{
return $this->currency($value, true, $includeContainer);
return self::currency($value, true, $includeContainer);
}

/**
Expand Down
10 changes: 5 additions & 5 deletions app/code/core/Mage/Downloadable/Block/Catalog/Product/Links.php
Original file line number Diff line number Diff line change
Expand Up @@ -103,14 +103,14 @@ public function getFormattedLinkPrice($link)

$priceStr = '<span class="price-notice">+';
if ($taxHelper->displayPriceIncludingTax()) {
$priceStr .= $coreHelper->currencyByStore($_priceInclTax, $store);
$priceStr .= $coreHelper::currencyByStore($_priceInclTax, $store);
} elseif ($taxHelper->displayPriceExcludingTax()) {
$priceStr .= $coreHelper->currencyByStore($_priceExclTax, $store);
$priceStr .= $coreHelper::currencyByStore($_priceExclTax, $store);
} elseif ($taxHelper->displayBothPrices()) {
$priceStr .= $coreHelper->currencyByStore($_priceExclTax, $store);
$priceStr .= $coreHelper::currencyByStore($_priceExclTax, $store);
if ($_priceInclTax != $_priceExclTax) {
$priceStr .= ' (+'.$coreHelper
->currencyByStore($_priceInclTax, $store).' '.$this->__('Incl. Tax').')';
::currencyByStore($_priceInclTax, $store).' '.$this->__('Incl. Tax').')';
}
}
$priceStr .= '</span>';
Expand Down Expand Up @@ -141,7 +141,7 @@ public function getJsonConfig()
$coreHelper = Mage::helper('core');

foreach ($this->getLinks() as $link) {
$config[$link->getId()] = $coreHelper->currency($link->getPrice(), false, false);
$config[$link->getId()] = $coreHelper::currency($link->getPrice(), false, false);
}

return $coreHelper->jsonEncode($config);
Expand Down
20 changes: 10 additions & 10 deletions app/code/core/Mage/Paypal/Model/Ipn.php
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ protected function _processOrder()
protected function _registerAdjustment()
{
$reasonCode = isset($this->_request['reason_code']) ? $this->_request['reason_code'] : null;
$reasonComment = $this->_info->explainReasonCode($reasonCode);
$reasonComment = $this->_info::explainReasonCode($reasonCode);
$notificationAmount = $this->_order->getBaseCurrency()->formatTxt($this->_request['mc_gross']);
/**
* Add IPN comment about registered dispute
Expand All @@ -323,9 +323,9 @@ protected function _registerAdjustment()
protected function _registerDispute()
{
$reasonCode = isset($this->_request['reason_code']) ? $this->_request['reason_code'] : null;
$reasonComment = $this->_info->explainReasonCode($reasonCode);
$reasonComment = $this->_info::explainReasonCode($reasonCode);
$caseType = isset($this->_request['case_type']) ? $this->_request['case_type'] : null;
$caseTypeLabel = $this->_info->getCaseTypeLabel($caseType);
$caseTypeLabel = $this->_info::getCaseTypeLabel($caseType);
$caseId = isset($this->_request['case_id']) ? $this->_request['case_id'] : null;
/**
* Add IPN comment about registered dispute
Expand Down Expand Up @@ -544,7 +544,7 @@ protected function _registerPaymentRefund()
{
$this->_importPaymentInformation();
$reason = $this->getRequestData('reason_code');
$isRefundFinal = !$this->_info->isReversalDisputable($reason);
$isRefundFinal = !$this->_info::isReversalDisputable($reason);

/** @var Mage_Sales_Model_Order_Payment $payment */
$payment = $this->_order->getPayment();
Expand All @@ -555,7 +555,7 @@ protected function _registerPaymentRefund()
$payment->getMethodInstance()->getCode(),
$this->getRequestData('txn_id')
);
$comment = $this->_createIpnComment($this->_info->explainReasonCode($reason))
$comment = $this->_createIpnComment($this->_info::explainReasonCode($reason))
. ' '
. Mage::helper('paypal')->__('Refunded amount of %s. Transaction ID: "%s"', $amount, $transactionId);

Expand Down Expand Up @@ -585,7 +585,7 @@ protected function _registerPaymentRefund()
protected function _registerPaymentReversal()
{
$reasonCode = isset($this->_request['reason_code']) ? $this->_request['reason_code'] : null;
$reasonComment = $this->_info->explainReasonCode($reasonCode);
$reasonComment = $this->_info::explainReasonCode($reasonCode);
$notificationAmount = $this->_order
->getBaseCurrency()
->formatTxt($this->_request['mc_gross'] + $this->_request['mc_fee']);
Expand Down Expand Up @@ -638,7 +638,7 @@ public function _registerPaymentPending()
$this->_importPaymentInformation();

$this->_order->getPayment()
->setPreparedMessage($this->_createIpnComment($this->_info->explainPendingReason($reason)))
->setPreparedMessage($this->_createIpnComment($this->_info::explainPendingReason($reason)))
->setTransactionId($this->getRequestData('txn_id'))
->setIsTransactionClosed(0)
->registerPaymentReviewAction(Mage_Sales_Model_Order_Payment::REVIEW_ACTION_UPDATE, false);
Expand Down Expand Up @@ -767,15 +767,15 @@ protected function _importPaymentInformation()
* TODO: implement logic in one place
* @see Mage_Paypal_Model_Pro::importPaymentInfo()
*/
if ($this->_info->isPaymentReviewRequired($payment)) {
if ($this->_info::isPaymentReviewRequired($payment)) {
$payment->setIsTransactionPending(true);
if ($fraudFilters) {
$payment->setIsFraudDetected(true);
}
}
if ($this->_info->isPaymentSuccessful($payment)) {
if ($this->_info::isPaymentSuccessful($payment)) {
$payment->setIsTransactionApproved(true);
} elseif ($this->_info->isPaymentFailed($payment)) {
} elseif ($this->_info::isPaymentFailed($payment)) {
$payment->setIsTransactionDenied(true);
}

Expand Down
2 changes: 1 addition & 1 deletion app/code/core/Mage/Paypal/Model/Payflowpro.php
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ public function fetchTransactionInfo(Mage_Payment_Model_Info $payment, $transact

$this->_processErrors($response);

if (!$this->_isTransactionUnderReview($response->getOrigresult())) {
if (!self::_isTransactionUnderReview($response->getOrigresult())) {
$payment->setTransactionId($response->getOrigpnref())
->setIsTransactionClosed(0);
if ($response->getOrigresult() == self::RESPONSE_CODE_APPROVED) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,8 @@ protected function _toHtml()
protected function _prepareForm()
{
$form = new Varien_Data_Form();
$form->setFieldsetRenderer($this->getLayout()->createBlock('adminhtml/widget_form_renderer_fieldset'));
$form->setFieldsetElementRenderer($this->getLayout()
$form::setFieldsetRenderer($this->getLayout()->createBlock('adminhtml/widget_form_renderer_fieldset'));
$form::setFieldsetElementRenderer($this->getLayout()
->createBlock('adminhtml/widget_form_renderer_fieldset_element'));

/**
Expand Down
2 changes: 1 addition & 1 deletion app/code/core/Mage/Sales/Model/Order/Item.php
Original file line number Diff line number Diff line change
Expand Up @@ -520,7 +520,7 @@ protected function _getQtyChildrenBackordered()
*/
public function getStatus()
{
return $this->getStatusName($this->getStatusId());
return self::getStatusName($this->getStatusId());
}

/**
Expand Down
Loading