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

Replaces full class name with self #2749

Merged
merged 5 commits into from
Nov 20, 2022
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
4 changes: 2 additions & 2 deletions app/code/core/Mage/Api2/Model/Acl/Global/Role.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand All @@ -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');

Expand Down
2 changes: 1 addition & 1 deletion app/code/core/Mage/Api2/Model/Resource.php
Original file line number Diff line number Diff line change
Expand Up @@ -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))
) {
Expand Down
2 changes: 1 addition & 1 deletion app/code/core/Mage/Captcha/Helper/Data.php
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion app/code/core/Mage/Core/Model/Locale.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
6 changes: 3 additions & 3 deletions app/code/core/Mage/Core/Model/Store.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion app/code/core/Mage/Directory/Model/Currency.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.'));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion app/code/core/Mage/Oauth/Model/Token.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down
6 changes: 3 additions & 3 deletions app/code/core/Mage/Paypal/Model/Express/Checkout.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down Expand Up @@ -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);
}

Expand Down
6 changes: 3 additions & 3 deletions app/code/core/Mage/PaypalUk/Model/Pro.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand All @@ -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(
Expand Down Expand Up @@ -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(
Expand Down
4 changes: 2 additions & 2 deletions app/code/core/Mage/Persistent/Model/Session.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down Expand Up @@ -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;
}

Expand Down
2 changes: 1 addition & 1 deletion app/code/core/Mage/Sales/Model/Quote/Address.php
Original file line number Diff line number Diff line change
Expand Up @@ -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()));
}

Expand Down
2 changes: 1 addition & 1 deletion app/code/core/Mage/SalesRule/Helper/Coupon.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
6 changes: 3 additions & 3 deletions app/code/core/Mage/SalesRule/Model/Rule.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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;
Expand Down