From 457b2efebfe816953329acd822f7c39f08f853f6 Mon Sep 17 00:00:00 2001 From: sreichel Date: Mon, 11 May 2020 02:27:29 +0200 Subject: [PATCH 1/2] Replaces full class name with self --- app/code/core/Mage/Api2/Model/Acl/Global/Role.php | 4 ++-- app/code/core/Mage/Api2/Model/Resource.php | 2 +- app/code/core/Mage/Captcha/Helper/Data.php | 2 +- app/code/core/Mage/Core/Model/Locale.php | 4 ++-- app/code/core/Mage/Core/Model/Store.php | 6 +++--- app/code/core/Mage/Directory/Model/Currency.php | 8 ++++---- .../Mage/ImportExport/Model/Import/Entity/Product.php | 4 ++-- app/code/core/Mage/Oauth/Model/Token.php | 2 +- app/code/core/Mage/Paypal/Block/Iframe.php | 2 +- app/code/core/Mage/Paypal/Model/Express/Checkout.php | 4 ++-- app/code/core/Mage/PaypalUk/Model/Pro.php | 6 +++--- app/code/core/Mage/Persistent/Model/Session.php | 6 +++--- app/code/core/Mage/Sales/Model/Order/Item.php | 2 +- .../Mage/Sales/Model/Order/Payment/Transaction.php | 10 +++++----- app/code/core/Mage/Sales/Model/Quote/Address.php | 2 +- app/code/core/Mage/SalesRule/Helper/Coupon.php | 2 +- app/code/core/Mage/SalesRule/Model/Rule.php | 6 +++--- app/code/core/Mage/Shipping/Model/Rate/Result.php | 2 +- .../Usa/Model/Shipping/Carrier/Dhl/Label/Pdf/Page.php | 2 +- app/code/core/Mage/XmlConnect/Model/Application.php | 2 +- app/code/core/Mage/XmlConnect/Model/Configuration.php | 8 ++++---- app/code/core/Mage/XmlConnect/Model/Queue.php | 8 ++++---- 22 files changed, 47 insertions(+), 47 deletions(-) diff --git a/app/code/core/Mage/Api2/Model/Acl/Global/Role.php b/app/code/core/Mage/Api2/Model/Acl/Global/Role.php index 846ebdccb10..7251dacdefc 100644 --- a/app/code/core/Mage/Api2/Model/Acl/Global/Role.php +++ b/app/code/core/Mage/Api2/Model/Acl/Global/Role.php @@ -89,7 +89,7 @@ protected function _beforeSave() } //check and protect guest role - if (Mage_Api2_Model_Acl_Global_Role::isSystemRole($this) + if (self::isSystemRole($this) && $this->getRoleName() != $this->getOrigData('role_name')) { /** @var $helper Mage_Core_Helper_Data */ @@ -111,7 +111,7 @@ protected function _beforeSave() */ protected function _beforeDelete() { - if (Mage_Api2_Model_Acl_Global_Role::isSystemRole($this)) { + if (self::isSystemRole($this)) { /** @var $helper Mage_Core_Helper_Data */ $helper = Mage::helper('core'); diff --git a/app/code/core/Mage/Api2/Model/Resource.php b/app/code/core/Mage/Api2/Model/Resource.php index 5f5e55a613a..75d561c57a5 100644 --- a/app/code/core/Mage/Api2/Model/Resource.php +++ b/app/code/core/Mage/Api2/Model/Resource.php @@ -740,7 +740,7 @@ final protected function _applyCollectionModifiers(Varien_Data_Collection_Db $co $orderField = $this->getRequest()->getOrderField(); if (null !== $orderField) { - $operation = Mage_Api2_Model_Resource::OPERATION_ATTRIBUTE_READ; + $operation = self::OPERATION_ATTRIBUTE_READ; if (!is_string($orderField) || !array_key_exists($orderField, $this->getAvailableAttributes($this->getUserType(), $operation)) ) { diff --git a/app/code/core/Mage/Captcha/Helper/Data.php b/app/code/core/Mage/Captcha/Helper/Data.php index 86ed8105cf5..8ebbf0fa7cc 100644 --- a/app/code/core/Mage/Captcha/Helper/Data.php +++ b/app/code/core/Mage/Captcha/Helper/Data.php @@ -96,7 +96,7 @@ public function getConfigNode($id, $store = null) */ public function getFonts() { - $node = Mage::getConfig()->getNode(Mage_Captcha_Helper_Data::XML_PATH_CAPTCHA_FONTS); + $node = Mage::getConfig()->getNode(self::XML_PATH_CAPTCHA_FONTS); $fonts = array(); if ($node) { foreach ($node->children() as $fontName => $fontNode) { diff --git a/app/code/core/Mage/Core/Model/Locale.php b/app/code/core/Mage/Core/Model/Locale.php index 848e8f64448..8b0732e7bb8 100644 --- a/app/code/core/Mage/Core/Model/Locale.php +++ b/app/code/core/Mage/Core/Model/Locale.php @@ -455,7 +455,7 @@ public function getDateFormat($type=null) public function getDateFormatWithLongYear() { return preg_replace('/(?getTranslation(Mage_Core_Model_Locale::FORMAT_TYPE_SHORT, 'date')); + $this->getTranslation(self::FORMAT_TYPE_SHORT, 'date')); } /** @@ -568,7 +568,7 @@ public function utcDate($store=null, $date, $includeTime = false, $format = null { $dateObj = $this->storeDate($store, $date, $includeTime); $dateObj->set($date, $format); - $dateObj->setTimezone(Mage_Core_Model_Locale::DEFAULT_TIMEZONE); + $dateObj->setTimezone(self::DEFAULT_TIMEZONE); return $dateObj; } diff --git a/app/code/core/Mage/Core/Model/Store.php b/app/code/core/Mage/Core/Model/Store.php index 9fb9746c7a9..108c934b5eb 100644 --- a/app/code/core/Mage/Core/Model/Store.php +++ b/app/code/core/Mage/Core/Model/Store.php @@ -797,8 +797,8 @@ public function isCurrentlySecure() */ public function getBaseCurrencyCode() { - $configValue = $this->getConfig(Mage_Core_Model_Store::XML_PATH_PRICE_SCOPE); - if ($configValue == Mage_Core_Model_Store::PRICE_SCOPE_GLOBAL) { + $configValue = $this->getConfig(self::XML_PATH_PRICE_SCOPE); + if ($configValue == self::PRICE_SCOPE_GLOBAL) { return Mage::app()->getBaseCurrencyCode(); } else { return $this->getConfig(Mage_Directory_Model_Currency::XML_PATH_CURRENCY_BASE); @@ -1146,7 +1146,7 @@ public function getCurrentUrl($fromStore = true) $storeParsedQuery[$k] = $v; } - if (!Mage::getStoreConfigFlag(Mage_Core_Model_Store::XML_PATH_STORE_IN_URL, $this->getCode())) { + if (!Mage::getStoreConfigFlag(self::XML_PATH_STORE_IN_URL, $this->getCode())) { $storeParsedQuery['___store'] = $this->getCode(); } if ($fromStore !== false) { diff --git a/app/code/core/Mage/Directory/Model/Currency.php b/app/code/core/Mage/Directory/Model/Currency.php index b735e466a24..fec798e5f88 100644 --- a/app/code/core/Mage/Directory/Model/Currency.php +++ b/app/code/core/Mage/Directory/Model/Currency.php @@ -134,7 +134,7 @@ public function getRate($toCurrency) { if (is_string($toCurrency)) { $code = $toCurrency; - } elseif ($toCurrency instanceof Mage_Directory_Model_Currency) { + } elseif ($toCurrency instanceof self) { $code = $toCurrency->getCurrencyCode(); } else { throw Mage::exception('Mage_Directory', Mage::helper('directory')->__('Invalid target currency.')); @@ -158,7 +158,7 @@ public function getAnyRate($toCurrency) { if (is_string($toCurrency)) { $code = $toCurrency; - } elseif ($toCurrency instanceof Mage_Directory_Model_Currency) { + } elseif ($toCurrency instanceof self) { $code = $toCurrency->getCurrencyCode(); } else { throw Mage::exception('Mage_Directory', Mage::helper('directory')->__('Invalid target currency.')); @@ -191,7 +191,7 @@ public function convert($price, $toCurrency = null) } throw new Exception(Mage::helper('directory')->__('Undefined rate from "%s-%s".', $this->getCode(), - $toCurrency instanceof Mage_Directory_Model_Currency ? $toCurrency->getCode() : $toCurrency)); + $toCurrency instanceof self ? $toCurrency->getCode() : $toCurrency)); } /** @@ -336,7 +336,7 @@ public function getConfigBaseCurrencies() */ public function getCurrencyRates($currency, $toCurrencies = null) { - if ($currency instanceof Mage_Directory_Model_Currency) { + if ($currency instanceof self) { $currency = $currency->getCode(); } $data = $this->_getResource()->getCurrencyRates($currency, $toCurrencies); diff --git a/app/code/core/Mage/ImportExport/Model/Import/Entity/Product.php b/app/code/core/Mage/ImportExport/Model/Import/Entity/Product.php index 1a9c6195255..0a4d9a0d813 100644 --- a/app/code/core/Mage/ImportExport/Model/Import/Entity/Product.php +++ b/app/code/core/Mage/ImportExport/Model/Import/Entity/Product.php @@ -1472,12 +1472,12 @@ protected function _saveProducts() $previousType = $productType; } if (isset($rowData[self::COL_ATTR_SET]) && !is_null($rowData[self::COL_ATTR_SET])) { - $previousAttributeSet = $rowData[Mage_ImportExport_Model_Import_Entity_Product::COL_ATTR_SET]; + $previousAttributeSet = $rowData[self::COL_ATTR_SET]; } if (self::SCOPE_NULL == $rowScope) { // for multiselect attributes only if (!is_null($previousAttributeSet)) { - $rowData[Mage_ImportExport_Model_Import_Entity_Product::COL_ATTR_SET] = $previousAttributeSet; + $rowData[self::COL_ATTR_SET] = $previousAttributeSet; } if (is_null($productType) && !is_null($previousType)) { $productType = $previousType; diff --git a/app/code/core/Mage/Oauth/Model/Token.php b/app/code/core/Mage/Oauth/Model/Token.php index e3ca5521d23..0c6c9f3f69e 100644 --- a/app/code/core/Mage/Oauth/Model/Token.php +++ b/app/code/core/Mage/Oauth/Model/Token.php @@ -151,7 +151,7 @@ public function authorize($userId, $userType) */ public function convertToAccess() { - if (Mage_Oauth_Model_Token::TYPE_REQUEST != $this->getType()) { + if (self::TYPE_REQUEST != $this->getType()) { Mage::throwException('Can not convert due to token is not request type'); } /** @var $helper Mage_Oauth_Helper_Data */ diff --git a/app/code/core/Mage/Paypal/Block/Iframe.php b/app/code/core/Mage/Paypal/Block/Iframe.php index 34c7746c304..b5ee61e1b5b 100644 --- a/app/code/core/Mage/Paypal/Block/Iframe.php +++ b/app/code/core/Mage/Paypal/Block/Iframe.php @@ -96,7 +96,7 @@ protected function _getBlock() $this->_block = $this->getAction() ->getLayout() ->createBlock('paypal/'.$this->_paymentMethodCode.'_iframe'); - if (!$this->_block instanceof Mage_Paypal_Block_Iframe) { + if (!$this->_block instanceof self) { Mage::throwException('Invalid block type'); } } diff --git a/app/code/core/Mage/Paypal/Model/Express/Checkout.php b/app/code/core/Mage/Paypal/Model/Express/Checkout.php index 76cd32ca8ca..f3eb41d69ff 100644 --- a/app/code/core/Mage/Paypal/Model/Express/Checkout.php +++ b/app/code/core/Mage/Paypal/Model/Express/Checkout.php @@ -404,7 +404,7 @@ public function start($returnUrl, $cancelUrl, $button = null) public function canSkipOrderReviewStep() { $isOnepageCheckout = !$this->_quote->getPayment() - ->getAdditionalInformation(Mage_Paypal_Model_Express_Checkout::PAYMENT_INFO_BUTTON); + ->getAdditionalInformation(self::PAYMENT_INFO_BUTTON); return $this->_config->isOrderReviewStepDisabled() && $isOnepageCheckout; } @@ -619,7 +619,7 @@ public function place($token, $shippingMethodCode = null) // commence redirecting to finish payment, if paypal requires it if ($order->getPayment()->getAdditionalInformation( - Mage_Paypal_Model_Express_Checkout::PAYMENT_INFO_TRANSPORT_REDIRECT + self::PAYMENT_INFO_TRANSPORT_REDIRECT )) { $this->_redirectUrl = $this->_config->getExpressCheckoutCompleteUrl($token); } diff --git a/app/code/core/Mage/PaypalUk/Model/Pro.php b/app/code/core/Mage/PaypalUk/Model/Pro.php index 53ea718f8d9..9a9f198b21e 100644 --- a/app/code/core/Mage/PaypalUk/Model/Pro.php +++ b/app/code/core/Mage/PaypalUk/Model/Pro.php @@ -87,7 +87,7 @@ protected function _getParentTransactionId(Varien_Object $payment) { if ($payment->getParentTransactionId()) { return $payment->getTransaction($payment->getParentTransactionId()) - ->getAdditionalInformation(Mage_PaypalUk_Model_Pro::TRANSPORT_PAYFLOW_TXN_ID); + ->getAdditionalInformation(self::TRANSPORT_PAYFLOW_TXN_ID); } return $payment->getParentTransactionId(); } @@ -103,7 +103,7 @@ protected function _importCaptureResultToPayment($api, $payment) $payment->setTransactionId($api->getPaypalTransactionId()) ->setIsTransactionClosed(false) ->setTransactionAdditionalInfo( - Mage_PaypalUk_Model_Pro::TRANSPORT_PAYFLOW_TXN_ID, + self::TRANSPORT_PAYFLOW_TXN_ID, $api->getTransactionId() ); $payment->setPreparedMessage( @@ -140,7 +140,7 @@ protected function _importRefundResultToPayment($api, $payment, $canRefundMore) ->setIsTransactionClosed(1) // refund initiated by merchant ->setShouldCloseParentTransaction(!$canRefundMore) ->setTransactionAdditionalInfo( - Mage_PaypalUk_Model_Pro::TRANSPORT_PAYFLOW_TXN_ID, + self::TRANSPORT_PAYFLOW_TXN_ID, $api->getTransactionId() ); $payment->setPreparedMessage( diff --git a/app/code/core/Mage/Persistent/Model/Session.php b/app/code/core/Mage/Persistent/Model/Session.php index e4ef380f51e..654655dbc77 100644 --- a/app/code/core/Mage/Persistent/Model/Session.php +++ b/app/code/core/Mage/Persistent/Model/Session.php @@ -148,7 +148,7 @@ protected function _afterLoad() public function loadByCookieKey($key = null) { if (is_null($key)) { - $key = Mage::getSingleton('core/cookie')->get(Mage_Persistent_Model_Session::COOKIE_NAME); + $key = Mage::getSingleton('core/cookie')->get(self::COOKIE_NAME); } if ($key) { $this->load($key, 'key'); @@ -191,7 +191,7 @@ public function deleteByCustomerId($customerId, $clearCookie = true) */ public function removePersistentCookie() { - Mage::getSingleton('core/cookie')->delete(Mage_Persistent_Model_Session::COOKIE_NAME); + Mage::getSingleton('core/cookie')->delete(self::COOKIE_NAME); return $this; } @@ -229,7 +229,7 @@ public function deleteExpired($websiteId = null) * @return Mage_Core_Model_Abstract */ protected function _afterDeleteCommit() { - Mage::getSingleton('core/cookie')->delete(Mage_Persistent_Model_Session::COOKIE_NAME); + Mage::getSingleton('core/cookie')->delete(self::COOKIE_NAME); return parent::_afterDeleteCommit(); } diff --git a/app/code/core/Mage/Sales/Model/Order/Item.php b/app/code/core/Mage/Sales/Model/Order/Item.php index 388ce175ee1..3437738d215 100644 --- a/app/code/core/Mage/Sales/Model/Order/Item.php +++ b/app/code/core/Mage/Sales/Model/Order/Item.php @@ -663,7 +663,7 @@ public function getRealProductType() */ public function addChildItem($item) { - if ($item instanceof Mage_Sales_Model_Order_Item) { + if ($item instanceof self) { $this->_children[] = $item; } else if (is_array($item)) { $this->_children = array_merge($this->_children, $item); diff --git a/app/code/core/Mage/Sales/Model/Order/Payment/Transaction.php b/app/code/core/Mage/Sales/Model/Order/Payment/Transaction.php index a2b955eaa79..e03c314f4d0 100644 --- a/app/code/core/Mage/Sales/Model/Order/Payment/Transaction.php +++ b/app/code/core/Mage/Sales/Model/Order/Payment/Transaction.php @@ -735,11 +735,11 @@ public function isVoided() public function getTransactionTypes() { return array( - Mage_Sales_Model_Order_Payment_Transaction::TYPE_ORDER => Mage::helper('sales')->__('Order'), - Mage_Sales_Model_Order_Payment_Transaction::TYPE_AUTH => Mage::helper('sales')->__('Authorization'), - Mage_Sales_Model_Order_Payment_Transaction::TYPE_CAPTURE => Mage::helper('sales')->__('Capture'), - Mage_Sales_Model_Order_Payment_Transaction::TYPE_VOID => Mage::helper('sales')->__('Void'), - Mage_Sales_Model_Order_Payment_Transaction::TYPE_REFUND => Mage::helper('sales')->__('Refund') + self::TYPE_ORDER => Mage::helper('sales')->__('Order'), + self::TYPE_AUTH => Mage::helper('sales')->__('Authorization'), + self::TYPE_CAPTURE => Mage::helper('sales')->__('Capture'), + self::TYPE_VOID => Mage::helper('sales')->__('Void'), + self::TYPE_REFUND => Mage::helper('sales')->__('Refund') ); } diff --git a/app/code/core/Mage/Sales/Model/Quote/Address.php b/app/code/core/Mage/Sales/Model/Quote/Address.php index e81d1709566..f990498efa0 100644 --- a/app/code/core/Mage/Sales/Model/Quote/Address.php +++ b/app/code/core/Mage/Sales/Model/Quote/Address.php @@ -284,7 +284,7 @@ protected function _populateBeforeSaveData() */ protected function _isSameAsBilling() { - return ($this->getAddressType() == Mage_Sales_Model_Quote_Address::TYPE_SHIPPING + return ($this->getAddressType() === self::TYPE_SHIPPING && ($this->_isNotRegisteredCustomer() || $this->_isDefaultShippingNullOrSameAsBillingAddress())); } diff --git a/app/code/core/Mage/SalesRule/Helper/Coupon.php b/app/code/core/Mage/SalesRule/Helper/Coupon.php index f813abb7b53..1ea502ea05f 100644 --- a/app/code/core/Mage/SalesRule/Helper/Coupon.php +++ b/app/code/core/Mage/SalesRule/Helper/Coupon.php @@ -142,6 +142,6 @@ public function getCharset($format) */ public function getCodeSeparator() { - return (string)Mage::app()->getConfig()->getNode(Mage_SalesRule_Helper_Coupon::XML_CHARSET_SEPARATOR); + return (string)Mage::app()->getConfig()->getNode(self::XML_CHARSET_SEPARATOR); } } diff --git a/app/code/core/Mage/SalesRule/Model/Rule.php b/app/code/core/Mage/SalesRule/Model/Rule.php index 3c086a37e9e..88d3b694660 100644 --- a/app/code/core/Mage/SalesRule/Model/Rule.php +++ b/app/code/core/Mage/SalesRule/Model/Rule.php @@ -387,8 +387,8 @@ public function getCouponTypes() { if ($this->_couponTypes === null) { $this->_couponTypes = array( - Mage_SalesRule_Model_Rule::COUPON_TYPE_NO_COUPON => Mage::helper('salesrule')->__('No Coupon'), - Mage_SalesRule_Model_Rule::COUPON_TYPE_SPECIFIC => Mage::helper('salesrule')->__('Specific Coupon'), + self::COUPON_TYPE_NO_COUPON => Mage::helper('salesrule')->__('No Coupon'), + self::COUPON_TYPE_SPECIFIC => Mage::helper('salesrule')->__('Specific Coupon'), ); $transport = new Varien_Object(array( 'coupon_types' => $this->_couponTypes, @@ -397,7 +397,7 @@ public function getCouponTypes() Mage::dispatchEvent('salesrule_rule_get_coupon_types', array('transport' => $transport)); $this->_couponTypes = $transport->getCouponTypes(); if ($transport->getIsCouponTypeAutoVisible()) { - $this->_couponTypes[Mage_SalesRule_Model_Rule::COUPON_TYPE_AUTO] = Mage::helper('salesrule')->__('Auto'); + $this->_couponTypes[self::COUPON_TYPE_AUTO] = Mage::helper('salesrule')->__('Auto'); } } return $this->_couponTypes; diff --git a/app/code/core/Mage/Shipping/Model/Rate/Result.php b/app/code/core/Mage/Shipping/Model/Rate/Result.php index f215e1630c6..1597ef914ed 100644 --- a/app/code/core/Mage/Shipping/Model/Rate/Result.php +++ b/app/code/core/Mage/Shipping/Model/Rate/Result.php @@ -87,7 +87,7 @@ public function append($result) if ($result instanceof Mage_Shipping_Model_Rate_Result_Abstract) { $this->_rates[] = $result; } - elseif ($result instanceof Mage_Shipping_Model_Rate_Result) { + elseif ($result instanceof self) { $rates = $result->getAllRates(); foreach ($rates as $rate) { $this->append($rate); diff --git a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/Label/Pdf/Page.php b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/Label/Pdf/Page.php index fd2625c6c7c..33e35f35d26 100644 --- a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/Label/Pdf/Page.php +++ b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/Label/Pdf/Page.php @@ -51,7 +51,7 @@ class Mage_Usa_Model_Shipping_Carrier_Dhl_Label_Pdf_Page extends Zend_Pdf_Page */ public function __construct($param1, $param2 = null, $param3 = null) { - if ($param1 instanceof Mage_Usa_Model_Shipping_Carrier_Dhl_Label_Pdf_Page + if ($param1 instanceof self && $param2 === null && $param3 === null ) { $this->_contents = $param1->getContents(); diff --git a/app/code/core/Mage/XmlConnect/Model/Application.php b/app/code/core/Mage/XmlConnect/Model/Application.php index 9a0cb51fd4d..6b4438c1e2c 100644 --- a/app/code/core/Mage/XmlConnect/Model/Application.php +++ b/app/code/core/Mage/XmlConnect/Model/Application.php @@ -300,7 +300,7 @@ protected function _construct() */ public function getIsSubmitted() { - return $this->getStatus() == Mage_XmlConnect_Model_Application::APP_STATUS_SUCCESS; + return $this->getStatus() === self::APP_STATUS_SUCCESS; } /** diff --git a/app/code/core/Mage/XmlConnect/Model/Configuration.php b/app/code/core/Mage/XmlConnect/Model/Configuration.php index 2f89fc853d6..28aaf14919f 100644 --- a/app/code/core/Mage/XmlConnect/Model/Configuration.php +++ b/app/code/core/Mage/XmlConnect/Model/Configuration.php @@ -81,7 +81,7 @@ class Mage_XmlConnect_Model_Configuration extends Mage_Core_Model_Abstract public function isActiveAdminApp() { $isActiveSetting = $this->_getAdminApplicationSettings( - Mage_XmlConnect_Model_Configuration::CONFIG_PATH_AA_SETTINGS . '/is_active' + self::CONFIG_PATH_AA_SETTINGS . '/is_active' ); return $isActiveSetting ? (bool)$isActiveSetting['value'] : false; } @@ -95,7 +95,7 @@ public function isActiveAdminApp() public function saveIsActiveAdminApp($isActive) { $this->_getConfigDataModel()->saveConfig( - Mage_XmlConnect_Model_Configuration::CONFIG_PATH_AA_SETTINGS . '/is_active', (int)$isActive + self::CONFIG_PATH_AA_SETTINGS . '/is_active', (int)$isActive ); return $this; } @@ -171,7 +171,7 @@ public function getDeviceStaticPages() public function getPreviousLocalizationHash() { $localizationHashSetting = $this->_getAdminApplicationSettings( - Mage_XmlConnect_Model_Configuration::CONFIG_PATH_AA_SETTINGS . '/localization_hash' + self::CONFIG_PATH_AA_SETTINGS . '/localization_hash' ); return $localizationHashSetting ? $localizationHashSetting['value'] : null; @@ -186,7 +186,7 @@ public function getPreviousLocalizationHash() public function setPreviousLocalizationHash($hash) { $this->_getConfigDataModel()->saveConfig( - Mage_XmlConnect_Model_Configuration::CONFIG_PATH_AA_SETTINGS . '/localization_hash', $hash + self::CONFIG_PATH_AA_SETTINGS . '/localization_hash', $hash ); return $this; } diff --git a/app/code/core/Mage/XmlConnect/Model/Queue.php b/app/code/core/Mage/XmlConnect/Model/Queue.php index 12ae4deda8a..e931fda3011 100644 --- a/app/code/core/Mage/XmlConnect/Model/Queue.php +++ b/app/code/core/Mage/XmlConnect/Model/Queue.php @@ -197,7 +197,7 @@ public function getProcessedTemplate(array $variables = array()) EOT; switch ($this->getData('type')) { - case Mage_XmlConnect_Model_Queue::MESSAGE_TYPE_AIRMAIL: + case self::MESSAGE_TYPE_AIRMAIL: $html = sprintf($htmlDescription, Mage::helper('xmlconnect')->__('Push title')) . $this->getPushTitle() . sprintf($htmlDescription, Mage::helper('xmlconnect')->__('Message title')) @@ -205,7 +205,7 @@ public function getProcessedTemplate(array $variables = array()) . sprintf($htmlDescription, Mage::helper('xmlconnect')->__('Message content')) . $processor->filter($this->getContent()); break; - case Mage_XmlConnect_Model_Queue::MESSAGE_TYPE_PUSH: + case self::MESSAGE_TYPE_PUSH: default: $html = sprintf($htmlDescription, Mage::helper('xmlconnect')->__('Push title')) . $this->getPushTitle(); @@ -249,7 +249,7 @@ public function reset() public function getAirmailBroadcastParams() { $notificationType = Mage::getStoreConfig( - sprintf(Mage_XmlConnect_Model_Queue::XML_PATH_NOTIFICATION_TYPE, $this->getApplicationType()) + sprintf(self::XML_PATH_NOTIFICATION_TYPE, $this->getApplicationType()) ); $payload = array( @@ -280,7 +280,7 @@ public function getAirmailBroadcastParams() public function getPushBroadcastParams() { $notificationType = Mage::getStoreConfig( - sprintf(Mage_XmlConnect_Model_Queue::XML_PATH_NOTIFICATION_TYPE, $this->getApplicationType()) + sprintf(self::XML_PATH_NOTIFICATION_TYPE, $this->getApplicationType()) ); $payload = array( From 8b0b5350bf465703eea71f85c332f40d41beb85f Mon Sep 17 00:00:00 2001 From: Sven Reichel Date: Sun, 20 Nov 2022 08:42:29 +0100 Subject: [PATCH 2/2] Reverted instanceof --- app/code/core/Mage/Api2/Model/Acl/Global/Role.php | 2 +- app/code/core/Mage/Directory/Model/Currency.php | 6 +++--- app/code/core/Mage/Paypal/Block/Iframe.php | 2 +- app/code/core/Mage/Sales/Model/Order/Item.php | 2 +- .../Mage/Usa/Model/Shipping/Carrier/Dhl/Label/Pdf/Page.php | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/app/code/core/Mage/Api2/Model/Acl/Global/Role.php b/app/code/core/Mage/Api2/Model/Acl/Global/Role.php index a23c64e7ae1..58c6a7b0926 100644 --- a/app/code/core/Mage/Api2/Model/Acl/Global/Role.php +++ b/app/code/core/Mage/Api2/Model/Acl/Global/Role.php @@ -103,7 +103,7 @@ protected function _beforeSave() protected function _beforeDelete() { if (self::isSystemRole($this)) { - /** @var $helper Mage_Core_Helper_Data */ + /** @var Mage_Core_Helper_Data $helper */ $helper = Mage::helper('core'); Mage::throwException( diff --git a/app/code/core/Mage/Directory/Model/Currency.php b/app/code/core/Mage/Directory/Model/Currency.php index d82dbf45776..359b5fcda86 100644 --- a/app/code/core/Mage/Directory/Model/Currency.php +++ b/app/code/core/Mage/Directory/Model/Currency.php @@ -155,7 +155,7 @@ public function getAnyRate($toCurrency) { if (is_string($toCurrency)) { $code = $toCurrency; - } elseif ($toCurrency instanceof self) { + } elseif ($toCurrency instanceof Mage_Directory_Model_Currency) { $code = $toCurrency->getCurrencyCode(); } else { throw Mage::exception('Mage_Directory', Mage::helper('directory')->__('Invalid target currency.')); @@ -190,7 +190,7 @@ public function convert($price, $toCurrency = null) throw new Exception(Mage::helper('directory')->__( 'Undefined rate from "%s-%s".', $this->getCode(), - $toCurrency instanceof self ? $toCurrency->getCode() : $toCurrency + $toCurrency instanceof Mage_Directory_Model_Currency ? $toCurrency->getCode() : $toCurrency )); } @@ -337,7 +337,7 @@ public function getConfigBaseCurrencies() */ public function getCurrencyRates($currency, $toCurrencies = null) { - if ($currency instanceof self) { + if ($currency instanceof Mage_Directory_Model_Currency) { $currency = $currency->getCode(); } return $this->_getResource()->getCurrencyRates($currency, $toCurrencies); diff --git a/app/code/core/Mage/Paypal/Block/Iframe.php b/app/code/core/Mage/Paypal/Block/Iframe.php index 2a0a371c881..8ec24b0a929 100644 --- a/app/code/core/Mage/Paypal/Block/Iframe.php +++ b/app/code/core/Mage/Paypal/Block/Iframe.php @@ -92,7 +92,7 @@ protected function _getBlock() $this->_block = $this->getAction() ->getLayout() ->createBlock('paypal/' . $this->_paymentMethodCode . '_iframe'); - if (!$this->_block instanceof self) { + if (!$this->_block instanceof Mage_Paypal_Block_Iframe) { Mage::throwException('Invalid block type'); } } diff --git a/app/code/core/Mage/Sales/Model/Order/Item.php b/app/code/core/Mage/Sales/Model/Order/Item.php index 245357885a8..721dd604794 100644 --- a/app/code/core/Mage/Sales/Model/Order/Item.php +++ b/app/code/core/Mage/Sales/Model/Order/Item.php @@ -661,7 +661,7 @@ public function getRealProductType() */ public function addChildItem($item) { - if ($item instanceof self) { + if ($item instanceof Mage_Sales_Model_Order_Item) { $this->_children[] = $item; } elseif (is_array($item)) { $this->_children = array_merge($this->_children, $item); diff --git a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/Label/Pdf/Page.php b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/Label/Pdf/Page.php index 708b0bf454e..38a138e43bf 100644 --- a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/Label/Pdf/Page.php +++ b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/Label/Pdf/Page.php @@ -46,7 +46,7 @@ class Mage_Usa_Model_Shipping_Carrier_Dhl_Label_Pdf_Page extends Zend_Pdf_Page */ public function __construct($param1, $param2 = null, $param3 = null) { - if ($param1 instanceof self + if ($param1 instanceof Mage_Usa_Model_Shipping_Carrier_Dhl_Label_Pdf_Page && $param2 === null && $param3 === null ) { $this->_contents = $param1->getContents();