Skip to content

Commit ccb44f4

Browse files
committed
Merge remote-tracking branch 'origin/2.3-develop' into MAGETWO-93031
2 parents c8b89bf + cfaa388 commit ccb44f4

File tree

66 files changed

+1401
-32
lines changed

Some content is hidden

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

66 files changed

+1401
-32
lines changed

app/code/Magento/Backend/Block/Widget/Grid/Column/Renderer/Currency.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ public function render(\Magento\Framework\DataObject $row)
8282
{
8383
if ($data = (string)$this->_getValue($row)) {
8484
$currency_code = $this->_getCurrencyCode($row);
85-
$data = floatval($data) * $this->_getRate($row);
85+
$data = (float)$data * $this->_getRate($row);
8686
$sign = (bool)(int)$this->getColumn()->getShowNumberSign() && $data > 0 ? '+' : '';
8787
$data = sprintf("%f", $data);
8888
$data = $this->_localeCurrency->getCurrency($currency_code)->toCurrency($data);
@@ -118,10 +118,10 @@ protected function _getCurrencyCode($row)
118118
protected function _getRate($row)
119119
{
120120
if ($rate = $this->getColumn()->getRate()) {
121-
return floatval($rate);
121+
return (float)$rate;
122122
}
123123
if ($rate = $row->getData($this->getColumn()->getRateField())) {
124-
return floatval($rate);
124+
return (float)$rate;
125125
}
126126
return $this->_defaultBaseCurrency->getRate($this->_getCurrencyCode($row));
127127
}

app/code/Magento/Backend/Block/Widget/Grid/Column/Renderer/Price.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public function render(\Magento\Framework\DataObject $row)
6060
return $data;
6161
}
6262

63-
$data = floatval($data) * $this->_getRate($row);
63+
$data = (float)$data * $this->_getRate($row);
6464
$data = sprintf("%f", $data);
6565
$data = $this->_localeCurrency->getCurrency($currencyCode)->toCurrency($data);
6666
return $data;
@@ -94,10 +94,10 @@ protected function _getCurrencyCode($row)
9494
protected function _getRate($row)
9595
{
9696
if ($rate = $this->getColumn()->getRate()) {
97-
return floatval($rate);
97+
return (float)$rate;
9898
}
9999
if ($rate = $row->getData($this->getColumn()->getRateField())) {
100-
return floatval($rate);
100+
return (float)$rate;
101101
}
102102
return 1;
103103
}

app/code/Magento/Bundle/Pricing/Price/BundleSelectionFactory.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public function create(
5454
) {
5555
$arguments['bundleProduct'] = $bundleProduct;
5656
$arguments['saleableItem'] = $selection;
57-
$arguments['quantity'] = $quantity ? floatval($quantity) : 1.;
57+
$arguments['quantity'] = $quantity ? (float)$quantity : 1.;
5858

5959
return $this->objectManager->create(self::SELECTION_CLASS_DEFAULT, $arguments);
6060
}

app/code/Magento/Catalog/Model/Product/Type/AbstractType.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -935,7 +935,7 @@ public function getForceChildItemQtyChanges($product)
935935
*/
936936
public function prepareQuoteItemQty($qty, $product)
937937
{
938-
return floatval($qty);
938+
return (float)$qty;
939939
}
940940

941941
/**

app/code/Magento/Catalog/Model/ProductLink/Repository.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
use Magento\Catalog\Api\Data\ProductLinkExtensionFactory;
1111
use Magento\Catalog\Model\Product\Initialization\Helper\ProductLinks as LinksInitializer;
1212
use Magento\Catalog\Model\Product\LinkTypeProvider;
13+
use Magento\Framework\Api\SimpleDataObjectConverter;
1314
use Magento\Framework\Exception\CouldNotSaveException;
1415
use Magento\Framework\Exception\NoSuchEntityException;
1516
use Magento\Framework\EntityManager\MetadataPool;
@@ -170,7 +171,7 @@ public function getList(\Magento\Catalog\Api\Data\ProductInterface $product)
170171
foreach ($item['custom_attributes'] as $option) {
171172
$name = $option['attribute_code'];
172173
$value = $option['value'];
173-
$setterName = 'set'.ucfirst($name);
174+
$setterName = 'set' . SimpleDataObjectConverter::snakeCaseToUpperCamelCase($name);
174175
// Check if setter exists
175176
if (method_exists($productLinkExtension, $setterName)) {
176177
call_user_func([$productLinkExtension, $setterName], $value);

app/code/Magento/Catalog/Model/ResourceModel/Layer/Filter/Price.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ public function getCount($range)
112112
/**
113113
* Check and set correct variable values to prevent SQL-injections
114114
*/
115-
$range = floatval($range);
115+
$range = (float)$range;
116116
if ($range == 0) {
117117
$range = 1;
118118
}

app/code/Magento/Catalog/Pricing/Price/RegularPrice.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public function getValue()
2929
if ($this->value === null) {
3030
$price = $this->product->getPrice();
3131
$priceInCurrentCurrency = $this->priceCurrency->convertAndRound($price);
32-
$this->value = $priceInCurrentCurrency ? floatval($priceInCurrentCurrency) : 0;
32+
$this->value = $priceInCurrentCurrency ? (float)$priceInCurrentCurrency : 0;
3333
}
3434
return $this->value;
3535
}

app/code/Magento/Catalog/Pricing/Price/TierPrice.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ public function __construct(
8080
GroupManagementInterface $groupManagement,
8181
CustomerGroupRetrieverInterface $customerGroupRetriever = null
8282
) {
83-
$quantity = floatval($quantity) ? $quantity : 1;
83+
$quantity = (float)$quantity ? $quantity : 1;
8484
parent::__construct($saleableItem, $quantity, $calculator, $priceCurrency);
8585
$this->customerSession = $customerSession;
8686
$this->groupManagement = $groupManagement;

app/code/Magento/Catalog/Test/Unit/Model/Layer/Filter/DataProvider/PriceTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ public function testGetMaxPrice()
152152
$this->productCollection->expects($this->once())
153153
->method('getMaxPrice')
154154
->will($this->returnValue($maxPrice));
155-
$this->assertSame(floatval($maxPrice), $this->target->getMaxPrice());
155+
$this->assertSame((float)$maxPrice, $this->target->getMaxPrice());
156156
}
157157

158158
/**

app/code/Magento/CatalogInventory/Model/Stock/Item.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ public function getStockStatusChangedAuto()
206206
*/
207207
public function getQty()
208208
{
209-
return null === $this->_getData(static::QTY) ? null : floatval($this->_getData(static::QTY));
209+
return null === $this->_getData(static::QTY) ? null : (float)$this->_getData(static::QTY);
210210
}
211211

212212
/**

0 commit comments

Comments
 (0)