Skip to content

Commit 7af41cb

Browse files
Merge pull request #10072 from magento-gl/sept-comprs
[Bluetooth] Community Pull Requests delivery - Sept2 comprs
2 parents f0b6603 + 9691de7 commit 7af41cb

File tree

21 files changed

+191
-197
lines changed

21 files changed

+191
-197
lines changed

app/code/Magento/Catalog/Test/Unit/Block/Widget/LinkTest.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,10 +195,17 @@ public function testStoreCodeShouldBeIncludedInURLOnlyIfItIsConfiguredSo(
195195
[
196196
[Store::XML_PATH_USE_REWRITES, ReinitableConfigInterface::SCOPE_TYPE_DEFAULT, null, true],
197197
[Store::XML_PATH_UNSECURE_BASE_LINK_URL, ScopeConfigInterface::SCOPE_TYPE_DEFAULT, null, ''],
198+
]
199+
);
200+
$config->expects($this->any())
201+
->method('isSetFlag')
202+
->willReturnMap(
203+
[
198204
[
199205
Store::XML_PATH_STORE_IN_URL,
200206
ReinitableConfigInterface::SCOPE_TYPE_DEFAULT,
201-
null, $includeStoreCode
207+
null,
208+
$includeStoreCode
202209
]
203210
]
204211
);

app/code/Magento/OfflineShipping/Model/ResourceModel/Carrier/Tablerate/CSV/ColumnResolver.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22
/**
3-
* Copyright © Magento, Inc. All rights reserved.
4-
* See COPYING.txt for license details.
3+
* Copyright 2016 Adobe
4+
* All Rights Reserved.
55
*/
66

77
namespace Magento\OfflineShipping\Model\ResourceModel\Carrier\Tablerate\CSV;
@@ -22,7 +22,6 @@ class ColumnResolver
2222
self::COLUMN_COUNTRY => 0,
2323
self::COLUMN_REGION => 1,
2424
self::COLUMN_ZIP => 2,
25-
self::COLUMN_WEIGHT => 3, // @phpstan-ignore-line
2625
self::COLUMN_WEIGHT_DESTINATION => 3,
2726
self::COLUMN_PRICE => 4,
2827
];

app/code/Magento/OfflineShipping/Test/Unit/Model/ResourceModel/Carrier/Tablerate/CSV/ColumnResolverTest.php

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22
/**
3-
* Copyright © Magento, Inc. All rights reserved.
4-
* See COPYING.txt for license details.
3+
* Copyright 2016 Adobe
4+
* All Rights Reserved.
55
*/
66
declare(strict_types=1);
77

@@ -16,14 +16,15 @@
1616
*/
1717
class ColumnResolverTest extends TestCase
1818
{
19-
const CUSTOM_FIELD = 'custom_field';
19+
private const CUSTOM_FIELD = 'custom_field';
2020

21-
// phpstan:ignore
21+
/**
22+
* @var array<string, string>
23+
*/
2224
private static $values = [
2325
ColumnResolver::COLUMN_COUNTRY => 'country value',
2426
ColumnResolver::COLUMN_REGION => 'region value',
2527
ColumnResolver::COLUMN_ZIP => 'zip_value',
26-
ColumnResolver::COLUMN_WEIGHT => 'weight_value',
2728
ColumnResolver::COLUMN_WEIGHT_DESTINATION => 'weight_destination_value',
2829
ColumnResolver::COLUMN_PRICE => 'price_value',
2930
self::CUSTOM_FIELD => 'custom_value',
@@ -87,11 +88,6 @@ public static function getColumnValueDataProvider()
8788
ColumnResolver::COLUMN_ZIP,
8889
self::$values[ColumnResolver::COLUMN_ZIP],
8990
],
90-
// phpstan:ignore
91-
ColumnResolver::COLUMN_WEIGHT => [
92-
ColumnResolver::COLUMN_WEIGHT,
93-
self::$values[ColumnResolver::COLUMN_WEIGHT],
94-
],
9591
ColumnResolver::COLUMN_WEIGHT_DESTINATION => [
9692
ColumnResolver::COLUMN_WEIGHT_DESTINATION,
9793
self::$values[ColumnResolver::COLUMN_WEIGHT_DESTINATION],

app/code/Magento/OrderCancellationUi/view/frontend/web/js/cancel-order-modal.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ define([
1414
options = {
1515
type: 'popup',
1616
responsive: true,
17-
title: 'Cancel Order',
17+
title: $.mage.__('Cancel Order'),
1818
buttons: [{
1919
text: $.mage.__('Close'),
2020
class: 'action-secondary action-dismiss close-modal-button',

app/code/Magento/ProductAlert/Helper/Data.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,12 @@ public function getSaveUrl($type)
110110
/**
111111
* Create block instance
112112
*
113-
* @param string|\Magento\Framework\View\Element\AbstractBlock $block
114-
* @return \Magento\Framework\View\Element\AbstractBlock
113+
* @template T of \Magento\Framework\View\Element\AbstractBlock
114+
*
115+
* @param class-string<T>|T $block
116+
*
117+
* @return T
118+
*
115119
* @throws \Magento\Framework\Exception\LocalizedException
116120
*/
117121
public function createBlock($block)

app/code/Magento/Sales/Block/Adminhtml/Order/Comments/View.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,9 +109,9 @@ public function canSendCommentEmail()
109109
/**
110110
* Replace links in string
111111
*
112-
* @param array|string $data
112+
* @param string|int|float|\Stringable|array<string|int|float|\Stringable> $data
113113
* @param null|array $allowedTags
114-
* @return string
114+
* @return ($data is array ? string[] : string)
115115
*/
116116
public function escapeHtml($data, $allowedTags = null)
117117
{

app/code/Magento/Sales/Block/Adminhtml/Order/View/History.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22
/**
3-
* Copyright © Magento, Inc. All rights reserved.
4-
* See COPYING.txt for license details.
3+
* Copyright 2013 Adobe
4+
* All Rights Reserved.
55
*/
66
namespace Magento\Sales\Block\Adminhtml\Order\View;
77

@@ -132,9 +132,9 @@ public function isCustomerNotificationNotApplicable(\Magento\Sales\Model\Order\S
132132
/**
133133
* Replace links in string
134134
*
135-
* @param array|string $data
135+
* @param string|int|float|\Stringable|array<string|int|float|\Stringable> $data
136136
* @param null|array $allowedTags
137-
* @return string
137+
* @return ($data is array ? string[] : string)
138138
*/
139139
public function escapeHtml($data, $allowedTags = null)
140140
{

app/code/Magento/Sales/Helper/Admin.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22
/**
3-
* Copyright © Magento, Inc. All rights reserved.
4-
* See COPYING.txt for license details.
3+
* Copyright 2013 Adobe
4+
* All Rights Reserved.
55
*/
66
declare(strict_types=1);
77

@@ -154,9 +154,9 @@ public function applySalableProductTypesFilter($collection)
154154
/**
155155
* Escape string preserving links
156156
*
157-
* @param string $data
157+
* @param string|int|float|\Stringable|array<string|int|float|\Stringable> $data
158158
* @param null|array $allowedTags
159-
* @return string
159+
* @return ($data is array ? string[] : string)
160160
*/
161161
public function escapeHtmlWithLinks($data, $allowedTags = null)
162162
{

app/code/Magento/Store/App/Request/StorePathInfoValidator.php

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -77,17 +77,16 @@ public function __construct(
7777
*/
7878
public function getValidStoreCode(Http $request, string $pathInfo = '') : ?string
7979
{
80-
$useStoreCodeInUrl = (bool) $this->config->getValue(Store::XML_PATH_STORE_IN_URL);
81-
if (!$useStoreCodeInUrl) {
80+
if (!$this->config->isSetFlag(Store::XML_PATH_STORE_IN_URL)) {
8281
return null;
8382
}
8483

85-
if (empty($pathInfo)) {
84+
if ($pathInfo === '') {
8685
$pathInfo = $this->pathInfo->getPathInfo($request->getRequestUri(), $request->getBaseUrl());
8786
}
8887
$storeCode = $this->getStoreCode($pathInfo);
8988

90-
if (empty($storeCode) || $storeCode === Store::ADMIN_CODE || !$this->storeCodeValidator->isValid($storeCode)) {
89+
if ($storeCode === '' || $storeCode === Store::ADMIN_CODE || !$this->storeCodeValidator->isValid($storeCode)) {
9190
return null;
9291
}
9392

@@ -98,14 +97,9 @@ public function getValidStoreCode(Http $request, string $pathInfo = '') : ?strin
9897
try {
9998
$this->storeRepository->getActiveStoreByCode($storeCode);
10099

101-
$this->validatedStoreCodes[$storeCode] = $storeCode;
102-
return $storeCode;
103-
} catch (NoSuchEntityException $e) {
104-
$this->validatedStoreCodes[$storeCode] = null;
105-
return null;
106-
} catch (StoreIsInactiveException $e) {
107-
$this->validatedStoreCodes[$storeCode] = null;
108-
return null;
100+
return $this->validatedStoreCodes[$storeCode] = $storeCode;
101+
} catch (NoSuchEntityException|StoreIsInactiveException) {
102+
return $this->validatedStoreCodes[$storeCode] = null;
109103
}
110104
}
111105

app/code/Magento/Store/Model/Store.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -764,8 +764,8 @@ protected function _updatePathUseStoreView($url)
764764
public function isUseStoreInUrl()
765765
{
766766
return !($this->hasDisableStoreInUrl() && $this->getDisableStoreInUrl())
767-
&& !$this->getConfig(StoreManager::XML_PATH_SINGLE_STORE_MODE_ENABLED)
768-
&& $this->getConfig(self::XML_PATH_STORE_IN_URL);
767+
&& !$this->_config->isSetFlag(StoreManager::XML_PATH_SINGLE_STORE_MODE_ENABLED)
768+
&& $this->_config->isSetFlag(self::XML_PATH_STORE_IN_URL);
769769
}
770770

771771
/**

0 commit comments

Comments
 (0)