Skip to content

Commit a5ae514

Browse files
authored
Cast type, ref #735 (#2872)
1 parent 43037c1 commit a5ae514

File tree

94 files changed

+203
-203
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

94 files changed

+203
-203
lines changed

app/code/core/Mage/Admin/Model/Resource/User.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ public function _saveRelations(Mage_Core_Model_Abstract $user)
235235

236236
$adapter->delete($this->getTable('admin/role'), $conditions);
237237
foreach ($rolesIds as $rid) {
238-
$rid = intval($rid);
238+
$rid = (int) $rid;
239239
if ($rid > 0) {
240240
$role = Mage::getModel('admin/role')->load($rid);
241241
} else {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ protected function _beforeSave()
180180
$this->cleanPasswordsValidationData();
181181

182182
if (!is_null($this->getIsActive())) {
183-
$data['is_active'] = intval($this->getIsActive());
183+
$data['is_active'] = (int) $this->getIsActive();
184184
}
185185

186186
$this->addData($data);

app/code/core/Mage/Adminhtml/Block/Api/Buttons.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ public function getSaveButtonHtml()
9494

9595
public function getDeleteButtonHtml()
9696
{
97-
if (intval($this->getRequest()->getParam('rid')) == 0) {
97+
if ((int) $this->getRequest()->getParam('rid') == 0) {
9898
return;
9999
}
100100
return $this->getChildHtml('deleteButton');

app/code/core/Mage/Adminhtml/Block/Api/Editroles.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ protected function _beforeToHtml()
5353
'content' => $this->getLayout()->createBlock('adminhtml/api_tab_rolesedit')->toHtml(),
5454
]);
5555

56-
if (intval($roleId) > 0) {
56+
if ((int) $roleId > 0) {
5757
$this->addTab('roles', [
5858
'label' => Mage::helper('adminhtml')->__('Role Users'),
5959
'title' => Mage::helper('adminhtml')->__('Role Users'),

app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/Set/Main/Formgroup.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,8 @@ protected function _prepareForm()
7474

7575
protected function _getSetId()
7676
{
77-
return (intval($this->getRequest()->getParam('id')) > 0)
78-
? intval($this->getRequest()->getParam('id'))
77+
return ((int) $this->getRequest()->getParam('id') > 0)
78+
? (int) $this->getRequest()->getParam('id')
7979
: Mage::getModel('eav/entity_type')
8080
->load(Mage::registry('entityType'))
8181
->getDefaultAttributeSetId();

app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Action/Attribute/Tab/Inventory.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ public function getFieldSuffix()
5656
public function getStoreId()
5757
{
5858
$storeId = $this->getRequest()->getParam('store');
59-
return intval($storeId);
59+
return (int) $storeId;
6060
}
6161

6262
/**

app/code/core/Mage/Adminhtml/Block/Permissions/Buttons.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ public function getSaveButtonHtml()
9494

9595
public function getDeleteButtonHtml()
9696
{
97-
if (intval($this->getRequest()->getParam('rid')) == 0) {
97+
if ((int) $this->getRequest()->getParam('rid') == 0) {
9898
return;
9999
}
100100
return $this->getChildHtml('deleteButton');

app/code/core/Mage/Adminhtml/Block/Report/Grid/Column/Renderer/Currency.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public function render(Varien_Object $row)
4343
return $data;
4444
}
4545

46-
$data = floatval($data) * $this->_getRate($row);
46+
$data = (float) $data * $this->_getRate($row);
4747
$data = sprintf("%F", $data);
4848
$data = Mage::app()->getLocale()->currency($currency_code)->toCurrency($data);
4949
return $data;

app/code/core/Mage/Adminhtml/Block/Review/Rating/Detailed.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,10 +80,10 @@ public function getRating()
8080
->setPositionOrder()
8181
->load()
8282
->addOptionToItems();
83-
if (intval($this->getRequest()->getParam('id'))) {
83+
if ((int) $this->getRequest()->getParam('id')) {
8484
$this->_voteCollection = Mage::getModel('rating/rating_option_vote')
8585
->getResourceCollection()
86-
->setReviewFilter(intval($this->getRequest()->getParam('id')))
86+
->setReviewFilter((int) $this->getRequest()->getParam('id'))
8787
->addOptionInfo()
8888
->load()
8989
->addRatingOptions();

app/code/core/Mage/Adminhtml/Block/Sales/Items/Abstract.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,7 @@ public function displayPriceInclTax(Varien_Object $item)
349349
$basePriceTax = 0;
350350
$priceTax = 0;
351351

352-
if (floatval($qty)) {
352+
if ((float) $qty) {
353353
$basePriceTax = $item->getBasePrice() + $baseTax / $qty;
354354
$priceTax = $item->getPrice() + $tax / $qty;
355355
}

0 commit comments

Comments
 (0)