Skip to content

Commit 0a13e00

Browse files
sreichelfballiano
authored andcommitted
Converted all (bool)getStoreConfig() calls to getStoreConfigFlag() (#2747)
1 parent 43557e6 commit 0a13e00

File tree

11 files changed

+26
-26
lines changed

11 files changed

+26
-26
lines changed

app/code/core/Mage/Admin/Model/Session.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -332,6 +332,6 @@ protected function _loginFailed($e, $request, $username, $message)
332332
*/
333333
protected function allowAdminSid()
334334
{
335-
return (bool) Mage::getStoreConfig(self::XML_PATH_ALLOW_SID_FOR_ADMIN_AREA);
335+
return Mage::getStoreConfigFlag(self::XML_PATH_ALLOW_SID_FOR_ADMIN_AREA);
336336
}
337337
}

app/code/core/Mage/Api/Model/Server/Adapter/Soap.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ protected function getWsdlUrl($params = null, $withAuth = true)
254254
protected function _instantiateServer()
255255
{
256256
$apiConfigCharset = Mage::getStoreConfig('api/config/charset');
257-
$wsdlCacheEnabled = (bool) Mage::getStoreConfig('api/config/wsdl_cache_enabled');
257+
$wsdlCacheEnabled = Mage::getStoreConfigFlag('api/config/wsdl_cache_enabled');
258258

259259
if ($wsdlCacheEnabled) {
260260
ini_set('soap.wsdl_cache_enabled', '1');

app/code/core/Mage/Catalog/Helper/Data.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ public function getOldFieldMap()
302302
*/
303303
public function isMsrpEnabled()
304304
{
305-
return (bool)Mage::getStoreConfig(self::XML_PATH_MSRP_ENABLED, $this->_storeId);
305+
return Mage::getStoreConfigFlag(self::XML_PATH_MSRP_ENABLED, $this->_storeId);
306306
}
307307

308308
/**
@@ -322,7 +322,7 @@ public function getMsrpDisplayActualPriceType()
322322
*/
323323
public function isMsrpApplyToAll()
324324
{
325-
return (bool)Mage::getStoreConfig(self::XML_PATH_MSRP_APPLY_TO_ALL, $this->_storeId);
325+
return Mage::getStoreConfigFlag(self::XML_PATH_MSRP_APPLY_TO_ALL, $this->_storeId);
326326
}
327327

328328
/**

app/code/core/Mage/Checkout/Block/Cart/Shipping.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -153,8 +153,8 @@ public function getEstimateRegion()
153153
*/
154154
public function getCityActive()
155155
{
156-
return (bool)Mage::getStoreConfig('carriers/dhl/active')
157-
|| (bool)Mage::getStoreConfig('carriers/dhlint/active');
156+
return Mage::getStoreConfigFlag('carriers/dhl/active')
157+
|| Mage::getStoreConfigFlag('carriers/dhlint/active');
158158
}
159159

160160
/**
@@ -164,9 +164,9 @@ public function getCityActive()
164164
*/
165165
public function getStateActive()
166166
{
167-
return (bool)Mage::getStoreConfig('carriers/dhl/active')
168-
|| (bool)Mage::getStoreConfig('carriers/tablerate/active')
169-
|| (bool)Mage::getStoreConfig('carriers/dhlint/active');
167+
return Mage::getStoreConfigFlag('carriers/dhl/active')
168+
|| Mage::getStoreConfigFlag('carriers/tablerate/active')
169+
|| Mage::getStoreConfigFlag('carriers/dhlint/active');
170170
}
171171

172172
/**

app/code/core/Mage/Checkout/Helper/Data.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ public function getRequiredAgreementIds()
100100
*/
101101
public function canOnepageCheckout()
102102
{
103-
return (bool)Mage::getStoreConfig('checkout/options/onepage_checkout_enabled');
103+
return Mage::getStoreConfigFlag('checkout/options/onepage_checkout_enabled');
104104
}
105105

106106
/**

app/code/core/Mage/ConfigurableSwatches/Helper/Data.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public function isEnabled()
4545
{
4646
if (is_null($this->_enabled)) {
4747
$this->_enabled = (
48-
(bool) Mage::getStoreConfig(self::CONFIG_PATH_ENABLED)
48+
Mage::getStoreConfigFlag(self::CONFIG_PATH_ENABLED)
4949
&& Mage::helper('configurableswatches/productlist')->getSwatchAttribute()
5050
);
5151
}

app/code/core/Mage/Customer/Helper/Address.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,11 @@ class Mage_Customer_Helper_Address extends Mage_Core_Helper_Abstract
3131
/**
3232
* VAT Validation parameters XML paths
3333
*/
34-
public const XML_PATH_VIV_DISABLE_AUTO_ASSIGN_DEFAULT = 'customer/create_account/viv_disable_auto_group_assign_default';
35-
public const XML_PATH_VIV_ON_EACH_TRANSACTION = 'customer/create_account/viv_on_each_transaction';
36-
public const XML_PATH_VAT_VALIDATION_ENABLED = 'customer/create_account/auto_group_assign';
34+
public const XML_PATH_VIV_DISABLE_AUTO_ASSIGN_DEFAULT = 'customer/create_account/viv_disable_auto_group_assign_default';
35+
public const XML_PATH_VIV_ON_EACH_TRANSACTION = 'customer/create_account/viv_on_each_transaction';
36+
public const XML_PATH_VAT_VALIDATION_ENABLED = 'customer/create_account/auto_group_assign';
3737
public const XML_PATH_VIV_TAX_CALCULATION_ADDRESS_TYPE = 'customer/create_account/tax_calculation_address_type';
38-
public const XML_PATH_VAT_FRONTEND_VISIBILITY = 'customer/create_account/vat_frontend_visibility';
38+
public const XML_PATH_VAT_FRONTEND_VISIBILITY = 'customer/create_account/vat_frontend_visibility';
3939

4040
protected $_moduleName = 'Mage_Customer';
4141

@@ -246,7 +246,7 @@ public function convertStreetLines($origStreets, $toCount)
246246
*/
247247
public function isVatValidationEnabled($store = null)
248248
{
249-
return (bool)Mage::getStoreConfig(self::XML_PATH_VAT_VALIDATION_ENABLED, $store);
249+
return Mage::getStoreConfigFlag(self::XML_PATH_VAT_VALIDATION_ENABLED, $store);
250250
}
251251

252252
/**
@@ -256,7 +256,7 @@ public function isVatValidationEnabled($store = null)
256256
*/
257257
public function getDisableAutoGroupAssignDefaultValue()
258258
{
259-
return (bool)Mage::getStoreConfig(self::XML_PATH_VIV_DISABLE_AUTO_ASSIGN_DEFAULT);
259+
return Mage::getStoreConfigFlag(self::XML_PATH_VIV_DISABLE_AUTO_ASSIGN_DEFAULT);
260260
}
261261

262262
/**
@@ -267,7 +267,7 @@ public function getDisableAutoGroupAssignDefaultValue()
267267
*/
268268
public function getValidateOnEachTransaction($store = null)
269269
{
270-
return (bool)Mage::getStoreConfig(self::XML_PATH_VIV_ON_EACH_TRANSACTION, $store);
270+
return Mage::getStoreConfigFlag(self::XML_PATH_VIV_ON_EACH_TRANSACTION, $store);
271271
}
272272

273273
/**
@@ -288,6 +288,6 @@ public function getTaxCalculationAddressType($store = null)
288288
*/
289289
public function isVatAttributeVisible()
290290
{
291-
return (bool)Mage::getStoreConfig(self::XML_PATH_VAT_FRONTEND_VISIBILITY);
291+
return Mage::getStoreConfigFlag(self::XML_PATH_VAT_FRONTEND_VISIBILITY);
292292
}
293293
}

app/code/core/Mage/Customer/Model/Customer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -754,7 +754,7 @@ public function isConfirmationRequired()
754754
}
755755
if (self::$_isConfirmationRequired === null) {
756756
$storeId = $this->getStoreId() ?: null;
757-
self::$_isConfirmationRequired = (bool)Mage::getStoreConfig(self::XML_PATH_IS_CONFIRM, $storeId);
757+
self::$_isConfirmationRequired = Mage::getStoreConfigFlag(self::XML_PATH_IS_CONFIRM, $storeId);
758758
}
759759

760760
return self::$_isConfirmationRequired;

app/code/core/Mage/Directory/Helper/Data.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@ public function getCountriesWithStatesRequired($asJson = false)
297297
*/
298298
public function getShowNonRequiredState()
299299
{
300-
return (bool)Mage::getStoreConfig(self::XML_PATH_DISPLAY_ALL_STATES);
300+
return Mage::getStoreConfigFlag(self::XML_PATH_DISPLAY_ALL_STATES);
301301
}
302302

303303
/**

app/code/core/Mage/Rss/Block/List.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ public function getRssMiscFeeds()
142142
public function newProductRssFeed()
143143
{
144144
$path = self::XML_PATH_RSS_METHODS . '/catalog/new';
145-
if ((bool)Mage::getStoreConfig($path)) {
145+
if (Mage::getStoreConfigFlag($path)) {
146146
$this->addRssFeed($path, $this->__('New Products'));
147147
}
148148
}
@@ -153,7 +153,7 @@ public function newProductRssFeed()
153153
public function specialProductRssFeed()
154154
{
155155
$path = self::XML_PATH_RSS_METHODS . '/catalog/special';
156-
if ((bool)Mage::getStoreConfig($path)) {
156+
if (Mage::getStoreConfigFlag($path)) {
157157
$this->addRssFeed($path, $this->__('Special Products'), [], true);
158158
}
159159
}
@@ -164,7 +164,7 @@ public function specialProductRssFeed()
164164
public function salesRuleProductRssFeed()
165165
{
166166
$path = self::XML_PATH_RSS_METHODS . '/catalog/salesrule';
167-
if ((bool)Mage::getStoreConfig($path)) {
167+
if (Mage::getStoreConfigFlag($path)) {
168168
$this->addRssFeed($path, $this->__('Coupons/Discounts'), [], true);
169169
}
170170
}
@@ -176,7 +176,7 @@ public function salesRuleProductRssFeed()
176176
public function categoriesRssFeed()
177177
{
178178
$path = self::XML_PATH_RSS_METHODS . '/catalog/category';
179-
if ((bool)Mage::getStoreConfig($path)) {
179+
if (Mage::getStoreConfigFlag($path)) {
180180
$category = Mage::getModel('catalog/category');
181181

182182
/** @var Varien_Data_Tree_Node $treeModel */

0 commit comments

Comments
 (0)