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 3cd30544863..58c6a7b0926 100644 --- a/app/code/core/Mage/Api2/Model/Acl/Global/Role.php +++ b/app/code/core/Mage/Api2/Model/Acl/Global/Role.php @@ -80,7 +80,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 Mage_Core_Helper_Data $helper */ @@ -102,7 +102,7 @@ protected function _beforeSave() */ protected function _beforeDelete() { - if (Mage_Api2_Model_Acl_Global_Role::isSystemRole($this)) { + if (self::isSystemRole($this)) { /** @var Mage_Core_Helper_Data $helper */ $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 1247805e158..b885c8e990d 100644 --- a/app/code/core/Mage/Api2/Model/Resource.php +++ b/app/code/core/Mage/Api2/Model/Resource.php @@ -736,7 +736,7 @@ final protected function _applyCollectionModifiers(Varien_Data_Collection_Db $co $orderField = $this->getRequest()->getOrderField(); if ($orderField !== null) { - $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 7a97c2ee3f5..324ffbbbe33 100644 --- a/app/code/core/Mage/Captcha/Helper/Data.php +++ b/app/code/core/Mage/Captcha/Helper/Data.php @@ -103,7 +103,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 = []; 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 af4406d4dfd..7aabc24a8b6 100644 --- a/app/code/core/Mage/Core/Model/Locale.php +++ b/app/code/core/Mage/Core/Model/Locale.php @@ -576,7 +576,7 @@ public function utcDate($store, $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 737311f628c..5a6ed8ef45a 100644 --- a/app/code/core/Mage/Core/Model/Store.php +++ b/app/code/core/Mage/Core/Model/Store.php @@ -825,8 +825,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); @@ -1174,7 +1174,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 07d570dd306..359b5fcda86 100644 --- a/app/code/core/Mage/Directory/Model/Currency.php +++ b/app/code/core/Mage/Directory/Model/Currency.php @@ -131,7 +131,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.')); 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 a999884c61a..6a3a6405d65 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 bcc0d435db9..345e4744f8d 100644 --- a/app/code/core/Mage/Oauth/Model/Token.php +++ b/app/code/core/Mage/Oauth/Model/Token.php @@ -145,7 +145,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 Mage_Oauth_Helper_Data $helper */ diff --git a/app/code/core/Mage/Paypal/Model/Express/Checkout.php b/app/code/core/Mage/Paypal/Model/Express/Checkout.php index 2f7576619a1..7132bdcc16e 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,8 +619,8 @@ 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 4060610d4f3..904c7dfda55 100644 --- a/app/code/core/Mage/PaypalUk/Model/Pro.php +++ b/app/code/core/Mage/PaypalUk/Model/Pro.php @@ -86,7 +86,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(); } @@ -102,7 +102,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( @@ -139,7 +139,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 245f1043a2c..74e1703f7f3 100644 --- a/app/code/core/Mage/Persistent/Model/Session.php +++ b/app/code/core/Mage/Persistent/Model/Session.php @@ -154,7 +154,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'); @@ -197,7 +197,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; } diff --git a/app/code/core/Mage/Sales/Model/Quote/Address.php b/app/code/core/Mage/Sales/Model/Quote/Address.php index 00f1a61b2fd..f11f2f15699 100644 --- a/app/code/core/Mage/Sales/Model/Quote/Address.php +++ b/app/code/core/Mage/Sales/Model/Quote/Address.php @@ -370,7 +370,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 b4c1ae256c5..b4b0e67bf33 100644 --- a/app/code/core/Mage/SalesRule/Helper/Coupon.php +++ b/app/code/core/Mage/SalesRule/Helper/Coupon.php @@ -139,6 +139,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 48fd0ea75d7..c416c528614 100644 --- a/app/code/core/Mage/SalesRule/Model/Rule.php +++ b/app/code/core/Mage/SalesRule/Model/Rule.php @@ -377,8 +377,8 @@ public function getCouponTypes() { if ($this->_couponTypes === null) { $this->_couponTypes = [ - 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([ 'coupon_types' => $this->_couponTypes, @@ -387,7 +387,7 @@ public function getCouponTypes() Mage::dispatchEvent('salesrule_rule_get_coupon_types', ['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;