Skip to content

Code improvement #16821

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

Merged
merged 8 commits into from
Jul 16, 2018
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
2 changes: 1 addition & 1 deletion app/code/Magento/Backend/App/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,6 @@ public function isSetFlag($path)
if ($path) {
$configPath .= '/' . $path;
}
return (bool) $this->appConfig->get(System::CONFIG_TYPE, $configPath);
return (bool)$this->appConfig->get(System::CONFIG_TYPE, $configPath);
}
}
2 changes: 1 addition & 1 deletion app/code/Magento/Backup/Model/ResourceModel/Db.php
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ public function getTableForeignKeysSql($tableName = null)
}

/**
* Return triggers fro table(s)
* Return triggers for table(s)
*
* @param string|null $tableName
* @param bool $addDropIfExists
Expand Down
8 changes: 4 additions & 4 deletions app/code/Magento/Braintree/Gateway/Config/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ public function getCountryAvailableCardTypes($country, $storeId = null)
*/
public function isCvvEnabled($storeId = null)
{
return (bool) $this->getValue(self::KEY_USE_CVV, $storeId);
return (bool)$this->getValue(self::KEY_USE_CVV, $storeId);
}

/**
Expand All @@ -142,7 +142,7 @@ public function isCvvEnabled($storeId = null)
*/
public function isVerify3DSecure($storeId = null)
{
return (bool) $this->getValue(self::KEY_VERIFY_3DSECURE, $storeId);
return (bool)$this->getValue(self::KEY_VERIFY_3DSECURE, $storeId);
}

/**
Expand Down Expand Up @@ -233,7 +233,7 @@ public function getSdkUrl()
*/
public function hasFraudProtection($storeId = null)
{
return (bool) $this->getValue(Config::FRAUD_PROTECTION, $storeId);
return (bool)$this->getValue(Config::FRAUD_PROTECTION, $storeId);
}

/**
Expand All @@ -244,7 +244,7 @@ public function hasFraudProtection($storeId = null)
*/
public function isActive($storeId = null)
{
return (bool) $this->getValue(self::KEY_ACTIVE, $storeId);
return (bool)$this->getValue(self::KEY_ACTIVE, $storeId);
}

/**
Expand Down
8 changes: 4 additions & 4 deletions app/code/Magento/Braintree/Gateway/Config/PayPal/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,15 +60,15 @@ public function __construct(
*/
public function isActive()
{
return (bool) $this->getValue(self::KEY_ACTIVE);
return (bool)$this->getValue(self::KEY_ACTIVE);
}

/**
* @return bool
*/
public function isDisplayShoppingCart()
{
return (bool) $this->getValue(self::KEY_DISPLAY_ON_SHOPPING_CART);
return (bool)$this->getValue(self::KEY_DISPLAY_ON_SHOPPING_CART);
}

/**
Expand All @@ -78,7 +78,7 @@ public function isDisplayShoppingCart()
*/
public function isAllowToEditShippingAddress()
{
return (bool) $this->getValue(self::KEY_ALLOW_TO_EDIT_SHIPPING_ADDRESS);
return (bool)$this->getValue(self::KEY_ALLOW_TO_EDIT_SHIPPING_ADDRESS);
}

/**
Expand Down Expand Up @@ -117,7 +117,7 @@ public function getTitle()
*/
public function isSkipOrderReview()
{
return (bool) $this->getValue('skip_order_review');
return (bool)$this->getValue('skip_order_review');
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,7 @@ private function switchTables()
private function moveDataFromReplicaTableToReplicaTables(array $dimensions)
{
if (!$dimensions) {
return ;
return;
}
//TODO: need to update logic for run this move only when replica table is not empty
$select = $this->dimensionTableMaintainer->getConnection()->select()->from(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ public function modifyPrice(IndexTableStructure $priceTable, array $entityIds =
{
// no need to run all queries if current products have no custom options
if (!$this->checkIfCustomOptionsExist($priceTable)) {
return ;
return;
}

$connection = $this->getConnection();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -589,7 +589,7 @@ private function getPreviousSetAttributes()
*/
private function isProductExists()
{
return (bool) $this->locator->getProduct()->getId();
return (bool)$this->locator->getProduct()->getId();
}

/**
Expand Down
2 changes: 1 addition & 1 deletion app/code/Magento/CatalogInventory/Model/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ public function getNotifyStockQty($store = null)
*/
public function getEnableQtyIncrements($store = null)
{
return (bool) $this->scopeConfig->getValue(
return (bool)$this->scopeConfig->getValue(
self::XML_PATH_ENABLE_QTY_INCREMENTS,
\Magento\Store\Model\ScopeInterface::SCOPE_STORE,
$store
Expand Down
26 changes: 13 additions & 13 deletions app/code/Magento/CatalogInventory/Model/Stock/Item.php
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ public function getProductId()
*/
public function getStockStatusChangedAuto()
{
return (bool) $this->_getData(static::STOCK_STATUS_CHANGED_AUTO);
return (bool)$this->_getData(static::STOCK_STATUS_CHANGED_AUTO);
}

/**
Expand All @@ -219,7 +219,7 @@ public function getIsInStock()
if (!$this->getManageStock()) {
return true;
}
return (bool) $this->_getData(static::IS_IN_STOCK);
return (bool)$this->_getData(static::IS_IN_STOCK);
}

/**
Expand All @@ -228,7 +228,7 @@ public function getIsInStock()
*/
public function getIsQtyDecimal()
{
return (bool) $this->_getData(static::IS_QTY_DECIMAL);
return (bool)$this->_getData(static::IS_QTY_DECIMAL);
}

/**
Expand All @@ -237,7 +237,7 @@ public function getIsQtyDecimal()
*/
public function getIsDecimalDivided()
{
return (bool) $this->_getData(static::IS_DECIMAL_DIVIDED);
return (bool)$this->_getData(static::IS_DECIMAL_DIVIDED);
}

/**
Expand Down Expand Up @@ -265,7 +265,7 @@ public function getShowDefaultNotificationMessage()
*/
public function getUseConfigMinQty()
{
return (bool) $this->_getData(static::USE_CONFIG_MIN_QTY);
return (bool)$this->_getData(static::USE_CONFIG_MIN_QTY);
}

/**
Expand All @@ -289,7 +289,7 @@ public function getMinQty()
*/
public function getUseConfigMinSaleQty()
{
return (bool) $this->_getData(static::USE_CONFIG_MIN_SALE_QTY);
return (bool)$this->_getData(static::USE_CONFIG_MIN_SALE_QTY);
}

/**
Expand All @@ -314,7 +314,7 @@ public function getMinSaleQty()
*/
public function getUseConfigMaxSaleQty()
{
return (bool) $this->_getData(static::USE_CONFIG_MAX_SALE_QTY);
return (bool)$this->_getData(static::USE_CONFIG_MAX_SALE_QTY);
}

/**
Expand All @@ -339,7 +339,7 @@ public function getMaxSaleQty()
*/
public function getUseConfigNotifyStockQty()
{
return (bool) $this->_getData(static::USE_CONFIG_NOTIFY_STOCK_QTY);
return (bool)$this->_getData(static::USE_CONFIG_NOTIFY_STOCK_QTY);
}

/**
Expand All @@ -361,7 +361,7 @@ public function getNotifyStockQty()
*/
public function getUseConfigEnableQtyInc()
{
return (bool) $this->_getData(static::USE_CONFIG_ENABLE_QTY_INC);
return (bool)$this->_getData(static::USE_CONFIG_ENABLE_QTY_INC);
}

/**
Expand All @@ -375,7 +375,7 @@ public function getEnableQtyIncrements()
if ($this->getUseConfigEnableQtyInc()) {
return $this->stockConfiguration->getEnableQtyIncrements($this->getStoreId());
}
return (bool) $this->getData(static::ENABLE_QTY_INCREMENTS);
return (bool)$this->getData(static::ENABLE_QTY_INCREMENTS);
}

/**
Expand All @@ -386,7 +386,7 @@ public function getEnableQtyIncrements()
*/
public function getUseConfigQtyIncrements()
{
return (bool) $this->_getData(static::USE_CONFIG_QTY_INCREMENTS);
return (bool)$this->_getData(static::USE_CONFIG_QTY_INCREMENTS);
}

/**
Expand Down Expand Up @@ -418,7 +418,7 @@ public function getQtyIncrements()
*/
public function getUseConfigBackorders()
{
return (bool) $this->_getData(static::USE_CONFIG_BACKORDERS);
return (bool)$this->_getData(static::USE_CONFIG_BACKORDERS);
}

/**
Expand All @@ -440,7 +440,7 @@ public function getBackorders()
*/
public function getUseConfigManageStock()
{
return (bool) $this->_getData(static::USE_CONFIG_MANAGE_STOCK);
return (bool)$this->_getData(static::USE_CONFIG_MANAGE_STOCK);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@
<config_path>section/group/field4</config_path>
</field>
<field id="field_5" translate="label" showInWebsite="1" type="text">
<label></label>
</field>
</group>
<group id="group_4" type="text" showInDefault="1" showInWebsite="1" showInStore="1">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ public function getPurchasedSeparatelyAttribute()
*/
public function isProductLinksCanBePurchasedSeparately()
{
return (bool) $this->getProduct()->getData('links_purchased_separately');
return (bool)$this->getProduct()->getData('links_purchased_separately');
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ public function getLinksTitle()
*/
public function isProductLinksCanBePurchasedSeparately()
{
return (bool) $this->locator->getProduct()->getData('links_purchased_separately');
return (bool)$this->locator->getProduct()->getData('links_purchased_separately');
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,6 @@ public function __construct($result = true)
*/
public function get()
{
return (bool) $this->result;
return (bool)$this->result;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,6 @@ public function getMerchantId()
*/
public function isButtonContext()
{
return (bool) $this->getData(self::IS_BUTTON_CONTEXT_INDEX);
return (bool)$this->getData(self::IS_BUTTON_CONTEXT_INDEX);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,6 @@
<attribute type="shared">1</attribute>
</field>
<field id="bml_wizard" translate="button_label" sortOrder="15" showInDefault="1" showInWebsite="1">
<label></label>
<button_label>Get Publisher ID from PayPal</button_label>
<button_url><![CDATA[https:/financing.paypal.com/ppfinportal/cart/index?dcp=4eff8563b9cc505e0b9afaff3256705081553c79]]></button_url>
<frontend_model>Magento\Paypal\Block\Adminhtml\System\Config\BmlApiWizard</frontend_model>
Expand Down
2 changes: 1 addition & 1 deletion app/code/Magento/Security/Model/Plugin/AuthSession.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,6 @@ private function addUserLogoutNotification()
*/
private function isAjaxRequest()
{
return (bool) $this->request->getParam('isAjax');
return (bool)$this->request->getParam('isAjax');
}
}
2 changes: 1 addition & 1 deletion app/code/Magento/Store/Model/BaseUrlChecker.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public function execute($uri, $request)
*/
public function isEnabled()
{
return (bool) $this->scopeConfig->getValue(
return (bool)$this->scopeConfig->getValue(
'web/url/redirect_to_base',
\Magento\Store\Model\ScopeInterface::SCOPE_STORE
);
Expand Down
2 changes: 1 addition & 1 deletion app/code/Magento/Tax/Helper/Data.php
Original file line number Diff line number Diff line change
Expand Up @@ -690,7 +690,7 @@ public function getDefaultProductTaxClass()
*/
public function isCrossBorderTradeEnabled($store = null)
{
return (bool) $this->_config->crossBorderTradeEnabled($store);
return (bool)$this->_config->crossBorderTradeEnabled($store);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion app/code/Magento/Tax/Model/Calculation/Rule.php
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ public function getPosition()
*/
public function getCalculateSubtotal()
{
return (bool) $this->getData(self::KEY_CALCULATE_SUBTOTAL);
return (bool)$this->getData(self::KEY_CALCULATE_SUBTOTAL);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public function getFormInputName()
*/
public function isReadonly()
{
return (bool) $this->getData('readonly');
return (bool)$this->getData('readonly');
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,6 @@ public function switchIndex(array $dimensions)
*/
public function isSwitched()
{
return (bool) $this->isSwitched;
return (bool)$this->isSwitched;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -767,7 +767,6 @@
<attribute type="shared">1</attribute>
</field>
<field id="bml_wizard" translate="button_label" sortOrder="15" showInDefault="1" showInWebsite="1">
<label></label>
<button_label>Get Publisher ID from PayPal</button_label>
<button_url><![CDATA[https:/financing.paypal.com/ppfinportal/cart/index?dcp=4eff8563b9cc505e0b9afaff3256705081553c79]]></button_url>
<frontend_model>Magento\Paypal\Block\Adminhtml\System\Config\BmlApiWizard</frontend_model>
Expand Down
2 changes: 1 addition & 1 deletion lib/internal/Magento/Framework/Config/FileIterator.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ public function next()
*/
public function valid()
{
return (bool) $this->key();
return (bool)$this->key();
}

/**
Expand Down
2 changes: 1 addition & 1 deletion lib/internal/Magento/Framework/Model/AbstractModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -620,7 +620,7 @@ protected function _hasModelChanged()
*/
public function isSaveAllowed()
{
return (bool) $this->_dataSaveAllowed;
return (bool)$this->_dataSaveAllowed;
}

/**
Expand Down
4 changes: 2 additions & 2 deletions lib/internal/Magento/Framework/Url.php
Original file line number Diff line number Diff line change
Expand Up @@ -390,13 +390,13 @@ protected function _isSecure()
{
if ($this->_request->isSecure()) {
if ($this->getRouteParamsResolver()->hasData('secure')) {
return (bool) $this->getRouteParamsResolver()->getData('secure');
return (bool)$this->getRouteParamsResolver()->getData('secure');
}
return true;
}

if ($this->getRouteParamsResolver()->hasData('secure_is_forced')) {
return (bool) $this->getRouteParamsResolver()->getData('secure');
return (bool)$this->getRouteParamsResolver()->getData('secure');
}

if (!$this->_getScope()->isUrlSecure()) {
Expand Down
2 changes: 1 addition & 1 deletion lib/web/mage/utils/wrapper.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ define([
return {

/**
* Wraps target function with a specified wrapper, which will recieve
* Wraps target function with a specified wrapper, which will receive
* reference to the original function as a first argument.
*
* @param {Function} target - Function to be wrapped.
Expand Down