Skip to content

Commit e376f10

Browse files
committed
CE#34567: Fix deprecation issues
1 parent 9b1016b commit e376f10

File tree

5 files changed

+14
-28
lines changed

5 files changed

+14
-28
lines changed

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

Lines changed: 5 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -27,36 +27,22 @@ class BundleRegularPrice extends \Magento\Catalog\Pricing\Price\RegularPrice imp
2727
*/
2828
protected $maximalPrice;
2929

30-
/**
31-
* @param Product $saleableItem
32-
* @param float $quantity
33-
* @param BundleCalculatorInterface $calculator
34-
* @param \Magento\Framework\Pricing\PriceCurrencyInterface $priceCurrency
35-
*/
36-
public function __construct(
37-
Product $saleableItem,
38-
$quantity,
39-
BundleCalculatorInterface $calculator,
40-
\Magento\Framework\Pricing\PriceCurrencyInterface $priceCurrency
41-
) {
42-
parent::__construct($saleableItem, $quantity, $calculator, $priceCurrency);
43-
}
44-
4530
/**
4631
* @inheritdoc
4732
*/
4833
public function getAmount()
4934
{
50-
if (!isset($this->amount[$this->getValue()])) {
51-
$price = $this->getValue();
35+
$price = $this->getValue();
36+
$valueIndex = (string) $price;
37+
if (!isset($this->amount[$valueIndex])) {
5238
if ($this->product->getPriceType() == Price::PRICE_TYPE_FIXED) {
5339
/** @var \Magento\Catalog\Pricing\Price\CustomOptionPrice $customOptionPrice */
5440
$customOptionPrice = $this->priceInfo->getPrice(CustomOptionPrice::PRICE_CODE);
5541
$price += $customOptionPrice->getCustomOptionRange(true, $this->getPriceCode());
5642
}
57-
$this->amount[$this->getValue()] = $this->calculator->getMinRegularAmount($price, $this->product);
43+
$this->amount[$valueIndex] = $this->calculator->getMinRegularAmount($price, $this->product);
5844
}
59-
return $this->amount[$this->getValue()];
45+
return $this->amount[$valueIndex];
6046
}
6147

6248
/**

app/code/Magento/Customer/Model/Address/AbstractAddress.php

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,9 @@ class AbstractAddress extends AbstractExtensibleModel implements AddressModelInt
4040
/**
4141
* Possible customer address types
4242
*/
43-
const TYPE_BILLING = 'billing';
43+
public const TYPE_BILLING = 'billing';
4444

45-
const TYPE_SHIPPING = 'shipping';
45+
public const TYPE_SHIPPING = 'shipping';
4646

4747
/**
4848
* Prefix of model events
@@ -73,8 +73,6 @@ class AbstractAddress extends AbstractExtensibleModel implements AddressModelInt
7373
protected static $_regionModels = [];
7474

7575
/**
76-
* Directory data
77-
*
7876
* @var \Magento\Directory\Helper\Data
7977
*/
8078
protected $_directoryData = null;
@@ -241,7 +239,7 @@ public function getStreetLine($number)
241239
public function getStreetFull()
242240
{
243241
$street = $this->getData('street');
244-
return is_array($street) ? implode("\n", $street) : $street;
242+
return is_array($street) ? implode("\n", $street) : ($street ?? '');
245243
}
246244

247245
/**

dev/tests/integration/testsuite/Magento/Shipping/Block/Adminhtml/Order/AddToPackageTest.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,13 +75,13 @@ public function testGetCommentsHtml(): void
7575
*
7676
* @magentoDataFixture Magento/Shipping/_files/shipping_with_carrier_data_different_currency_code.php
7777
*/
78-
public function testGetCurrencyCodeCustomValue ()
78+
public function testGetCurrencyCodeCustomValue()
7979
{
8080
$template = '/<span class="customs-value-currency">\s*?(?<currency>[A-Za-z]+)\s*?<\/span>/';
8181
$matches = [];
8282
preg_match($template, $this->getHtml(), $matches);
8383
$currency = $matches['currency'] ?? null;
84-
$this->assertEquals('FR',$currency );
84+
$this->assertEquals('FR', $currency);
8585
}
8686

8787
/**
@@ -102,6 +102,7 @@ private function getHtml()
102102
$this->registry->register('current_shipment', $shipment);
103103

104104
$block->setTemplate('Magento_Shipping::order/packaging/popup.phtml');
105+
$block->setNameInLayout('test');
105106

106107
return $block->toHtml();
107108
}

dev/tests/integration/testsuite/Magento/User/Block/User/Edit/Tab/MainTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ protected function setUp(): void
2828

2929
$this->_block = $objectManager->create(\Magento\User\Block\User\Edit\Tab\Main::class);
3030
$this->_block->setArea('adminhtml');
31+
$this->_block->setNameInLayout('test');
3132
$this->_user = $objectManager->create(\Magento\User\Model\User::class);
3233

3334
$objectManager->get(\Magento\Framework\Registry::class)->register('permissions_user', $this->_user);

lib/internal/Magento/Framework/Url/Decoder.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,14 @@ public function __construct(
2424
}
2525

2626
/**
27-
* base64_decode() for URLs decoding
27+
* Base64 decode for URL
2828
*
2929
* @param string $url
3030
* @return string
3131
*/
3232
public function decode($url)
3333
{
34-
$url = base64_decode(strtr($url, '-_,', '+/='));
34+
$url = $url !== null ? base64_decode(strtr($url, '-_,', '+/=')) : '';
3535
return $this->urlBuilder->sessionUrlVar($url);
3636
}
3737
}

0 commit comments

Comments
 (0)