Skip to content

Commit 8d52220

Browse files
committed
Merge branch '2.4.7-beta1-develop' into AC-8277
2 parents 166f638 + 8fab341 commit 8d52220

File tree

451 files changed

+11148
-1658
lines changed

Some content is hidden

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

451 files changed

+11148
-1658
lines changed

app/code/Magento/Authorization/Model/CompositeUserContext.php

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
namespace Magento\Authorization\Model;
88

99
use Magento\Framework\ObjectManager\Helper\Composite as CompositeHelper;
10+
use Magento\Framework\ObjectManager\ResetAfterRequestInterface;
1011

1112
/**
1213
* User context.
@@ -17,7 +18,7 @@
1718
* @api
1819
* @since 100.0.2
1920
*/
20-
class CompositeUserContext implements \Magento\Authorization\Model\UserContextInterface
21+
class CompositeUserContext implements \Magento\Authorization\Model\UserContextInterface, ResetAfterRequestInterface
2122
{
2223
/**
2324
* @var UserContextInterface[]
@@ -92,4 +93,12 @@ protected function getUserContext()
9293
}
9394
return $this->chosenUserContext;
9495
}
96+
97+
/**
98+
* @inheritDoc
99+
*/
100+
public function _resetState(): void
101+
{
102+
$this->chosenUserContext = null;
103+
}
95104
}

app/code/Magento/Bundle/Block/Catalog/Product/View/Type/Bundle.php

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
use Magento\Framework\DataObject;
2020
use Magento\Framework\Json\EncoderInterface;
2121
use Magento\Framework\Locale\FormatInterface;
22+
use Magento\Framework\ObjectManager\ResetAfterRequestInterface;
2223
use Magento\Framework\Stdlib\ArrayUtils;
2324

2425
/**
@@ -28,7 +29,7 @@
2829
* @since 100.0.2
2930
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
3031
*/
31-
class Bundle extends AbstractView
32+
class Bundle extends AbstractView implements ResetAfterRequestInterface
3233
{
3334
/**
3435
* @var array
@@ -421,4 +422,13 @@ function (&$selection, $selectionId) use ($preConfiguredQtys) {
421422

422423
return $options;
423424
}
425+
426+
/**
427+
* @inheritDoc
428+
*/
429+
public function _resetState(): void
430+
{
431+
$this->selectedOptions = [];
432+
$this->optionsPosition = [];
433+
}
424434
}

app/code/Magento/Bundle/Model/Plugin/Frontend/ProductIdentitiesExtender.php

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,12 @@
99

1010
use Magento\Bundle\Model\Product\Type as BundleType;
1111
use Magento\Catalog\Model\Product as CatalogProduct;
12+
use Magento\Framework\ObjectManager\ResetAfterRequestInterface;
1213

1314
/**
1415
* Add child identities to product identities on storefront.
1516
*/
16-
class ProductIdentitiesExtender
17+
class ProductIdentitiesExtender implements ResetAfterRequestInterface
1718
{
1819
/**
1920
* @var BundleType
@@ -68,4 +69,12 @@ private function getChildrenIds($entityId): array
6869

6970
return $this->cacheChildrenIds[$entityId];
7071
}
72+
73+
/**
74+
* @inheritDoc
75+
*/
76+
public function _resetState(): void
77+
{
78+
$this->cacheChildrenIds = [];
79+
}
7180
}

app/code/Magento/Bundle/Model/Plugin/ProductIdentitiesExtender.php

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,12 @@
99

1010
use Magento\Bundle\Model\Product\Type as BundleType;
1111
use Magento\Catalog\Model\Product as CatalogProduct;
12+
use Magento\Framework\ObjectManager\ResetAfterRequestInterface;
1213

1314
/**
1415
* Add parent identities to product identities.
1516
*/
16-
class ProductIdentitiesExtender
17+
class ProductIdentitiesExtender implements ResetAfterRequestInterface
1718
{
1819
/**
1920
* @var BundleType
@@ -68,4 +69,12 @@ private function getParentIdsByChild($entityId): array
6869

6970
return $this->cacheParentIdsByChild[$entityId];
7071
}
72+
73+
/**
74+
* @inheritDoc
75+
*/
76+
public function _resetState(): void
77+
{
78+
$this->cacheParentIdsByChild = [];
79+
}
7180
}

app/code/Magento/Bundle/Model/Product/SelectionProductsDisabledRequired.php

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
use Magento\Framework\EntityManager\MetadataPool;
1111
use Magento\Catalog\Model\Product\Attribute\Source\Status;
1212
use Magento\Bundle\Model\ResourceModel\Selection as BundleSelection;
13+
use Magento\Framework\ObjectManager\ResetAfterRequestInterface;
1314
use Magento\Store\Model\StoreManagerInterface;
1415
use Magento\Catalog\Model\ResourceModel\Product\CollectionFactory as ProductCollectionFactory;
1516
use Magento\Catalog\Model\Product;
@@ -18,7 +19,7 @@
1819
/**
1920
* Class to return ids of options and child products when all products in required option are disabled in bundle product
2021
*/
21-
class SelectionProductsDisabledRequired
22+
class SelectionProductsDisabledRequired implements ResetAfterRequestInterface
2223
{
2324
/**
2425
* @var BundleSelection
@@ -161,4 +162,12 @@ private function getCacheKey(int $bundleId, int $websiteId): string
161162
{
162163
return $bundleId . '-' . $websiteId;
163164
}
165+
166+
/**
167+
* @inheritDoc
168+
*/
169+
public function _resetState(): void
170+
{
171+
$this->productsDisabledRequired = [];
172+
}
164173
}

app/code/Magento/Bundle/Model/ResourceModel/Indexer/Price/DisabledProductOptionPriceModifier.php

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,12 @@
1515
use Magento\Framework\EntityManager\MetadataPool;
1616
use Magento\Catalog\Model\ResourceModel\Product\Indexer\Price\PriceModifierInterface;
1717
use Magento\Bundle\Model\ResourceModel\Selection as BundleSelection;
18+
use Magento\Framework\ObjectManager\ResetAfterRequestInterface;
1819

1920
/**
2021
* Remove bundle product from price index when all products in required option are disabled
2122
*/
22-
class DisabledProductOptionPriceModifier implements PriceModifierInterface
23+
class DisabledProductOptionPriceModifier implements PriceModifierInterface, ResetAfterRequestInterface
2324
{
2425
/**
2526
* @var ResourceConnection
@@ -145,4 +146,12 @@ private function getBundleIds(array $entityIds): \Traversable
145146
yield $id;
146147
}
147148
}
149+
150+
/**
151+
* @inheritDoc
152+
*/
153+
public function _resetState(): void
154+
{
155+
$this->websiteIdsOfProduct = [];
156+
}
148157
}

app/code/Magento/Bundle/Pricing/Adjustment/Calculator.php

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
use Magento\Bundle\Pricing\Price\BundleSelectionFactory;
1313
use Magento\Bundle\Pricing\Price\BundleSelectionPrice;
1414
use Magento\Catalog\Model\Product;
15+
use Magento\Framework\ObjectManager\ResetAfterRequestInterface;
1516
use Magento\Framework\Pricing\Adjustment\Calculator as CalculatorBase;
1617
use Magento\Framework\Pricing\Amount\AmountFactory;
1718
use Magento\Framework\Pricing\Amount\AmountInterface;
@@ -25,7 +26,7 @@
2526
* Bundle price calculator
2627
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
2728
*/
28-
class Calculator implements BundleCalculatorInterface
29+
class Calculator implements BundleCalculatorInterface, ResetAfterRequestInterface
2930
{
3031
/**
3132
* @var CalculatorBase
@@ -214,7 +215,8 @@ protected function getSelectionAmounts(Product $bundleProduct, $searchMin, $useR
214215
* @param Option $option
215216
* @param bool $canSkipRequiredOption
216217
* @return bool
217-
* @deprecated 100.2.0
218+
* @deprecated 100.2.0 Not used anymore.
219+
* @see Nothing
218220
*/
219221
protected function canSkipOption($option, $canSkipRequiredOption)
220222
{
@@ -226,7 +228,8 @@ protected function canSkipOption($option, $canSkipRequiredOption)
226228
*
227229
* @param Product $bundleProduct
228230
* @return bool
229-
* @deprecated 100.2.0
231+
* @deprecated 100.2.0 Not used anymore.
232+
* @see Nothing
230233
*/
231234
protected function hasRequiredOption($bundleProduct)
232235
{
@@ -245,6 +248,7 @@ function ($item) {
245248
* @param Product $saleableItem
246249
* @return \Magento\Bundle\Model\ResourceModel\Option\Collection
247250
* @deprecated 100.2.0
251+
* @see Nothing
248252
*/
249253
protected function getBundleOptions(Product $saleableItem)
250254
{
@@ -425,4 +429,12 @@ public function processOptions($option, $selectionPriceList, $searchMin = true)
425429
}
426430
return $result;
427431
}
432+
433+
/**
434+
* @inheritDoc
435+
*/
436+
public function _resetState(): void
437+
{
438+
$this->optionAmount = [];
439+
}
428440
}

app/code/Magento/Bundle/Pricing/Adjustment/DefaultSelectionPriceListProvider.php

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,14 @@
1111
use Magento\Catalog\Model\Product;
1212
use Magento\Bundle\Model\Product\Price;
1313
use Magento\Catalog\Helper\Data as CatalogData;
14+
use Magento\Framework\ObjectManager\ResetAfterRequestInterface;
1415
use Magento\Store\Model\StoreManagerInterface;
1516
use Magento\Store\Api\WebsiteRepositoryInterface;
1617

1718
/**
1819
* Provide lightweight implementation which uses price index
1920
*/
20-
class DefaultSelectionPriceListProvider implements SelectionPriceListProviderInterface
21+
class DefaultSelectionPriceListProvider implements SelectionPriceListProviderInterface, ResetAfterRequestInterface
2122
{
2223
/**
2324
* @var BundleSelectionFactory
@@ -245,4 +246,12 @@ private function getBundleOptions(Product $saleableItem)
245246
{
246247
return $saleableItem->getTypeInstance()->getOptionsCollection($saleableItem);
247248
}
249+
250+
/**
251+
* @inheritDoc
252+
*/
253+
public function _resetState(): void
254+
{
255+
$this->priceList = [];
256+
}
248257
}

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

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,15 @@
88
namespace Magento\Bundle\Pricing\Price;
99

1010
use Magento\Bundle\Pricing\Adjustment\BundleCalculatorInterface;
11+
use Magento\Framework\ObjectManager\ResetAfterRequestInterface;
1112
use Magento\Framework\Pricing\SaleableInterface;
1213
use Magento\Framework\Pricing\Amount\AmountInterface;
1314
use Magento\Catalog\Model\Product;
1415

1516
/**
1617
* Bundle option price calculation model.
1718
*/
18-
class BundleOptions
19+
class BundleOptions implements ResetAfterRequestInterface
1920
{
2021
/**
2122
* @var BundleCalculatorInterface
@@ -91,6 +92,7 @@ public function calculateOptions(
9192
/** @var \Magento\Bundle\Pricing\Price\BundleSelectionPrice $selectionPriceList */
9293
$selectionPriceList = $this->calculator->createSelectionPriceList($option, $bundleProduct);
9394
$selectionPriceList = $this->calculator->processOptions($option, $selectionPriceList, $searchMin);
95+
// phpcs:ignore Magento2.Performance.ForeachArrayMerge
9496
$priceList = array_merge($priceList, $selectionPriceList);
9597
}
9698
$amount = $this->calculator->calculateBundleAmount(0., $bundleProduct, $priceList);
@@ -135,4 +137,12 @@ public function getOptionSelectionAmount(
135137

136138
return $this->optionSelectionAmountCache[$cacheKey];
137139
}
140+
141+
/**
142+
* @inheritDoc
143+
*/
144+
public function _resetState(): void
145+
{
146+
$this->optionSelectionAmountCache = [];
147+
}
138148
}

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

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,16 @@
77
namespace Magento\Bundle\Pricing\Price;
88

99
use Magento\Bundle\Pricing\Adjustment\BundleCalculatorInterface;
10+
use Magento\Catalog\Pricing\Price\RegularPrice;
11+
use Magento\Framework\ObjectManager\ResetAfterRequestInterface;
1012
use Magento\Framework\Pricing\Amount\AmountInterface;
1113
use Magento\Catalog\Pricing\Price\CustomOptionPrice;
1214
use Magento\Bundle\Model\Product\Price;
1315

1416
/**
1517
* Bundle product regular price model
1618
*/
17-
class BundleRegularPrice extends \Magento\Catalog\Pricing\Price\RegularPrice implements RegularPriceInterface
19+
class BundleRegularPrice extends RegularPrice implements RegularPriceInterface, ResetAfterRequestInterface
1820
{
1921
/**
2022
* @var BundleCalculatorInterface
@@ -72,4 +74,13 @@ public function getMinimalPrice()
7274
{
7375
return $this->getAmount();
7476
}
77+
78+
/**
79+
* @inheritDoc
80+
*/
81+
public function _resetState(): void
82+
{
83+
$this->maximalPrice = null;
84+
$this->amount = [];
85+
}
7586
}

0 commit comments

Comments
 (0)