Skip to content

Commit bfce838

Browse files
Merge branch '2.4-develop' into commpr-10131-2907
2 parents bebb38e + edee5b1 commit bfce838

File tree

19 files changed

+664
-176
lines changed

19 files changed

+664
-176
lines changed

app/code/Magento/Catalog/Model/FrontendStorageConfigurationPool.php

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
* Copyright 2017 Adobe
44
* All Rights Reserved.
55
*/
6+
declare(strict_types=1);
67

78
namespace Magento\Catalog\Model;
89

@@ -17,18 +18,12 @@
1718
*/
1819
class FrontendStorageConfigurationPool
1920
{
20-
/**
21-
* @var array
22-
*/
23-
private $storageConfigurations;
24-
2521
/**
2622
* StorageConfigurationPool constructor.
2723
* @param array $storageConfigurations
2824
*/
29-
public function __construct(array $storageConfigurations = [])
25+
public function __construct(private array $storageConfigurations = [])
3026
{
31-
$this->storageConfigurations = $storageConfigurations;
3227
}
3328

3429
/**
@@ -40,16 +35,16 @@ public function __construct(array $storageConfigurations = [])
4035
*/
4136
public function get($namespace)
4237
{
43-
if (isset($this->storageConfigurations[$namespace])) {
44-
if (!$this->storageConfigurations[$namespace] instanceof FrontendStorageConfigurationInterface) {
45-
throw new LocalizedException(
46-
__(sprintf("Invalid pool type with namespace: %s", $namespace))
47-
);
48-
}
49-
} else {
38+
$storageConfiguration = $this->storageConfigurations[$namespace] ?? null;
39+
if ($storageConfiguration === null) {
5040
return false;
5141
}
42+
if (!$storageConfiguration instanceof FrontendStorageConfigurationInterface) {
43+
throw new LocalizedException(
44+
__("Invalid pool type with namespace: %1", $namespace)
45+
);
46+
}
5247

53-
return $this->storageConfigurations[$namespace];
48+
return $storageConfiguration;
5449
}
5550
}

app/code/Magento/CatalogInventory/Model/StockStateProvider.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
* Copyright 2014 Adobe
44
* All Rights Reserved.
55
*/
6+
declare(strict_types=1);
67

78
namespace Magento\CatalogInventory\Model;
89

@@ -169,13 +170,13 @@ public function checkQuoteItemQty(StockItemInterface $stockItem, $qty, $summaryQ
169170
if (!$this->checkQty($stockItem, $summaryQty) || !$this->checkQty($stockItem, $qty)) {
170171
$message = __('The requested qty. is not available');
171172
if ((int) $this->scopeConfig->getValue('cataloginventory/options/not_available_message') === 1) {
172-
$itemMessage = (__(sprintf(
173-
'Only %s of %s available',
173+
$itemMessage = __(
174+
'Only %1 of %2 available',
174175
$stockItem->getQty() - $stockItem->getMinQty(),
175176
$this->localeFormat->getNumber($qty)
176-
)));
177+
);
177178
} else {
178-
$itemMessage = (__('Not enough items for sale'));
179+
$itemMessage = __('Not enough items for sale');
179180
}
180181
$result->setHasError(true)
181182
->setErrorCode('qty_available')

app/code/Magento/ConfigurableImportExport/Model/Import/Product/Type/Configurable.php

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

78
namespace Magento\ConfigurableImportExport\Model\Import\Product\Type;
89

@@ -59,7 +60,7 @@ class Configurable extends \Magento\CatalogImportExport\Model\Import\Product\Typ
5960
self::ERROR_INVALID_OPTION_VALUE => 'Column configurable_variations: Invalid option value for attribute "%s"',
6061
self::ERROR_INVALID_WEBSITE => 'Invalid website code for super attribute',
6162
self::ERROR_DUPLICATED_VARIATIONS => 'SKU %s contains duplicated variations',
62-
self::ERROR_UNIDENTIFIABLE_VARIATION => 'Configurable variation "%s" is unidentifiable',
63+
self::ERROR_UNIDENTIFIABLE_VARIATION => 'Configurable variation "%1" is unidentifiable',
6364
];
6465

6566
/**
@@ -580,10 +581,8 @@ protected function _parseVariations($rowData)
580581
if (empty($fieldAndValuePairs['sku'])) {
581582
throw new LocalizedException(
582583
__(
583-
sprintf(
584-
$this->_messageTemplates[self::ERROR_UNIDENTIFIABLE_VARIATION],
585-
$variation
586-
)
584+
$this->_messageTemplates[self::ERROR_UNIDENTIFIABLE_VARIATION],
585+
$variation
587586
)
588587
);
589588
}

app/code/Magento/EavGraphQl/Model/GetAttributeSelectedOptionComposite.php

Lines changed: 3 additions & 5 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 2023 Adobe
4+
* All Rights Reserved.
55
*/
66
declare(strict_types=1);
77

@@ -39,9 +39,7 @@ public function __construct(array $providers = [])
3939
public function execute(string $entityType, array $customAttribute): ?array
4040
{
4141
if (!isset($this->providers[$entityType])) {
42-
throw new RuntimeException(
43-
__(sprintf('"%s" entity type not set in providers', $entityType))
44-
);
42+
throw new RuntimeException(__('"%1" entity type not set in providers', $entityType));
4543
}
4644
if (!$this->providers[$entityType] instanceof GetAttributeSelectedOptionInterface) {
4745
throw new RuntimeException(

app/code/Magento/EavGraphQl/Model/GetAttributeValueComposite.php

Lines changed: 3 additions & 5 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 2023 Adobe
4+
* All Rights Reserved.
55
*/
66
declare(strict_types=1);
77

@@ -39,9 +39,7 @@ public function __construct(array $providers = [])
3939
public function execute(string $entityType, array $customAttribute): ?array
4040
{
4141
if (!isset($this->providers[$entityType])) {
42-
throw new RuntimeException(
43-
__(sprintf('"%s" entity type not set in providers', $entityType))
44-
);
42+
throw new RuntimeException(__('"%1" entity type not set in providers', $entityType));
4543
}
4644
if (!$this->providers[$entityType] instanceof GetAttributeValueInterface) {
4745
throw new RuntimeException(

app/code/Magento/Email/view/adminhtml/templates/preview/iframeswitcher.phtml

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

77
/** @var \Magento\Backend\Block\Page $block */
88
/** @var \Magento\Framework\View\Helper\SecureHtmlRenderer $secureRenderer */
9+
/** @var \Magento\Framework\Escaper $escaper */
910
?>
1011
<div id="preview" class="cms-revision-preview">
1112
<iframe name="preview_iframe"
1213
id="preview_iframe"
1314
frameborder="0"
14-
title="<?= $block->escapeHtmlAttr(__('Preview')) ?>"
15+
title="<?= $escaper->escapeHtmlAttr(__('Preview')) ?>"
1516
width="100%"
16-
sandbox="allow-same-origin allow-pointer-lock"
17+
sandbox="allow-scripts allow-same-origin allow-pointer-lock"
1718
></iframe>
1819
<form id="preview_form"
19-
action="<?= $block->escapeUrl($block->getUrl('*/*/popup')) ?>"
20+
action="<?= $escaper->escapeUrl($block->getUrl('*/*/popup')) ?>"
2021
method="post"
2122
target="preview_iframe"
2223
>
2324
<input type="hidden" name="form_key" value="<?= /* @noEscape */ $block->getFormKey() ?>" />
2425
<?php foreach ($block->getPreviewFormViewModel()->getFormFields() as $name => $value): ?>
25-
<input type="hidden" name="<?= $block->escapeHtmlAttr($name) ?>" value="<?= $block->escapeHtmlAttr($value) ?>"/>
26+
<input type="hidden"
27+
name="<?= $escaper->escapeHtmlAttr($name) ?>"
28+
value="<?= $escaper->escapeHtmlAttr($value) ?>"
29+
/>
2630
<?php endforeach; ?>
2731
</form>
2832
</div>

app/code/Magento/QuoteGraphQl/Model/Resolver/CustomizableOptions.php

Lines changed: 6 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 2015 Adobe
4+
* * All Rights Reserved.
55
*/
66
declare(strict_types=1);
77

@@ -59,7 +59,10 @@ public function resolve(Field $field, $context, ResolveInfo $info, ?array $value
5959
$cartItem,
6060
(int)$customizableOptionId
6161
);
62-
$customizableOptionsData[] = $customizableOption;
62+
63+
if (!empty($customizableOption)) {
64+
$customizableOptionsData[] = $customizableOption;
65+
}
6366
}
6467
return $customizableOptionsData;
6568
}

0 commit comments

Comments
 (0)