Skip to content

Commit 7c8ef4d

Browse files
ACPT-1552
* fixing more classes * cleaning up more of the state-skip-list
1 parent 276e7d1 commit 7c8ef4d

File tree

6 files changed

+104
-82
lines changed

6 files changed

+104
-82
lines changed

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

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
use Magento\Catalog\Model\Product\Type\Simple;
1313
use Magento\Catalog\Model\ProductTypes\ConfigInterface;
1414
use Magento\Framework\Data\OptionSourceInterface;
15+
use Magento\Framework\ObjectManager\ResetAfterRequestInterface;
1516
use Magento\Framework\Pricing\PriceInfo\Factory as PriceInfoFactory;
1617

1718
/**
@@ -21,7 +22,7 @@
2122
* @api
2223
* @since 100.0.2
2324
*/
24-
class Type implements OptionSourceInterface
25+
class Type implements OptionSourceInterface, ResetAfterRequestInterface
2526
{
2627
const TYPE_SIMPLE = 'simple';
2728

@@ -57,7 +58,7 @@ class Type implements OptionSourceInterface
5758
/**
5859
* Price models
5960
*
60-
* @var array
61+
* @var array|null|Price
6162
*/
6263
protected $_priceModels;
6364

@@ -107,6 +108,14 @@ public function __construct(
107108
$this->_priceInfoFactory = $priceInfoFactory;
108109
}
109110

111+
/**
112+
* @inheritDoc
113+
*/
114+
public function _resetState(): void
115+
{
116+
$this->_priceModels = null;
117+
}
118+
110119
/**
111120
* Factory to product singleton product type instances
112121
*
@@ -136,7 +145,7 @@ public function factory($product)
136145
* Product type price model factory
137146
*
138147
* @param string $productType
139-
* @return \Magento\Catalog\Model\Product\Type\Price
148+
* @return Price
140149
*/
141150
public function priceFactory($productType)
142151
{

app/code/Magento/Catalog/Model/ResourceModel/Product.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -854,5 +854,9 @@ public function _resetState(): void
854854
{
855855
parent::_resetState();
856856
$this->availableCategoryIdsCache = [];
857+
$this->_type = null;
858+
$this->_entityTable = null;
859+
$this->_entityIdField = null;
860+
$this->linkIdField = null;
857861
}
858862
}

app/code/Magento/Eav/Model/Entity/AbstractEntity.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ abstract class AbstractEntity extends AbstractResource implements
5656
/**
5757
* Entity type configuration
5858
*
59-
* @var Type
59+
* @var Type|null
6060
*/
6161
protected $_type;
6262

@@ -89,7 +89,7 @@ abstract class AbstractEntity extends AbstractResource implements
8989
protected $_staticAttributes = [];
9090

9191
/**
92-
* @var string
92+
* @var string|null
9393
*/
9494
protected $_entityTable;
9595

@@ -103,7 +103,7 @@ abstract class AbstractEntity extends AbstractResource implements
103103
/**
104104
* Entity table identification field name
105105
*
106-
* @var string
106+
* @var string|null
107107
*/
108108
protected $_entityIdField;
109109

app/code/Magento/Quote/Model/QuoteRepository.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ class QuoteRepository implements CartRepositoryInterface, ResetAfterRequestInter
5555
protected $storeManager;
5656

5757
/**
58-
* @var QuoteCollection
58+
* @var QuoteCollection|null
5959
* @deprecated 101.0.0
6060
* @see $quoteCollectionFactory
6161
*/
@@ -137,6 +137,7 @@ public function _resetState(): void
137137
{
138138
$this->quotesById = [];
139139
$this->quotesByCustomerId = [];
140+
$this->quoteCollection = null;
140141
}
141142

142143
/**

app/code/Magento/SalesRule/Model/DeltaPriceRound.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,21 @@
77

88
namespace Magento\SalesRule\Model;
99

10+
use Magento\Framework\ObjectManager\ResetAfterRequestInterface;
1011
use Magento\Framework\Pricing\PriceCurrencyInterface;
1112

1213
/**
1314
* Round price and save rounding operation delta.
1415
*/
15-
class DeltaPriceRound
16+
class DeltaPriceRound implements ResetAfterRequestInterface
1617
{
1718
/**
1819
* @var PriceCurrencyInterface
1920
*/
2021
private $priceCurrency;
2122

2223
/**
23-
* @var float[]
24+
* @var float[]|null
2425
*/
2526
private $roundingDeltas;
2627

@@ -32,6 +33,11 @@ public function __construct(PriceCurrencyInterface $priceCurrency)
3233
$this->priceCurrency = $priceCurrency;
3334
}
3435

36+
public function _resetState(): void
37+
{
38+
$this->roundingDeltas = null;
39+
}
40+
3541
/**
3642
* Round price based on previous rounding operation delta.
3743
*

dev/tests/integration/framework/Magento/TestFramework/ApplicationStateComparator/_files/state-skip-list.php

Lines changed: 75 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -19,80 +19,82 @@
1919
Magento\Framework\App\Language\Dictionary::class => null, // dictionary paths
2020
Magento\Framework\Config\Scope::class => null, // scope changes during test
2121
Magento\Framework\App\ResourceConnection\Config::class => null, // configuration for connections
22-
Magento\SalesRule\Model\DeltaPriceRound::class => null,
23-
Magento\SalesRule\Helper\CartFixedDiscount::class => null,
24-
Magento\SalesRule\Api\Data\RuleInterfaceFactory::class => null,
25-
Magento\SalesRule\Api\Data\ConditionInterfaceFactory::class => null,
26-
Magento\SalesRule\Api\Data\RuleLabelInterfaceFactory::class => null,
27-
Magento\SalesRule\Model\Converter\ToDataModel::class => null,
28-
Magento\SalesRule\Model\Converter\ToModel::class => null,
29-
Magento\SalesRule\Api\Data\RuleSearchResultInterfaceFactory::class => null,
30-
Magento\SalesRule\Model\RuleRepository::class => null,
31-
Magento\SalesRule\Model\RuleFactory::class => null,
22+
Magento\Framework\Module\ModuleList::class => null, // This one is needed to pass on Jenkins build
23+
// Magento\SalesRule\Model\DeltaPriceRound::class => null,
24+
// Magento\SalesRule\Helper\CartFixedDiscount::class => null,
25+
// Magento\SalesRule\Api\Data\RuleInterfaceFactory::class => null,
26+
// Magento\SalesRule\Api\Data\ConditionInterfaceFactory::class => null,
27+
// Magento\SalesRule\Api\Data\RuleLabelInterfaceFactory::class => null,
28+
// Magento\SalesRule\Model\Converter\ToDataModel::class => null,
29+
// Magento\SalesRule\Model\Converter\ToModel::class => null,
30+
// Magento\SalesRule\Api\Data\RuleSearchResultInterfaceFactory::class => null,
31+
// Magento\SalesRule\Model\RuleRepository::class => null,
32+
// Magento\SalesRule\Model\RuleFactory::class => null,
3233
Magento\SalesSequence\Model\MetaFactory::class => null,
3334
Magento\SalesSequence\Model\ProfileFactory::class => null,
3435
Magento\SalesSequence\Model\ResourceModel\Profile::class => null,
35-
Magento\SalesSequence\Model\ResourceModel\Meta::class => null,
36+
// Magento\SalesSequence\Model\ResourceModel\Meta::class => null,
3637
Magento\SalesSequence\Model\SequenceFactory::class => null,
3738
Magento\SalesSequence\Model\Manager::class => null,
38-
Magento\Quote\Model\ResourceModel\Collection\Interceptor::class => null,
39-
Magento\Quote\Model\ResourceModel\Quote\Collection\Interceptor::class => null,
40-
Magento\Quote\Api\Data\ProductOptionInterfaceFactory::class => null,
41-
Magento\Quote\Model\Quote\Item\Interceptor::class => null,
42-
Magento\Quote\Model\Quote\Address\Interceptor::class => null,
43-
Magento\Quote\Model\ResourceModel\Quote::class => null,
44-
Magento\Quote\Model\QuoteIdToMaskedQuoteId::class => null,
45-
Magento\Quote\Model\Quote\Address\Total\Collector::class => null,
46-
Magento\Quote\Model\Quote\TotalsCollectorList::class => null,
47-
Magento\Quote\Model\Quote\TotalsCollector::class => null,
48-
Magento\Quote\Model\Quote::class => null,
49-
Magento\Quote\Model\Quote\ProductOptionFactory::class => null,
50-
Magento\Quote\Api\Data\ProductOptionExtensionFactory::class => null,
51-
Magento\Catalog\Model\ResourceModel\Product\Indexer\Price\IndexTableRowSizeEstimator::class => null,
52-
Magento\Catalog\Model\Indexer\Price\BatchSizeManagement::class => null,
53-
Magento\Catalog\Model\ResourceModel\Product\Indexer\Price\DefaultPrice::class => null,
54-
Magento\Catalog\Model\ResourceModel\Product\Indexer\Price\CompositeProductRelationsCalculator::class => null,
55-
Magento\Catalog\Model\ResourceModel\Product\Indexer\Price\CompositeProductRowSizeEstimator::class => null,
56-
Magento\Catalog\Model\Indexer\Price\CompositeProductBatchSizeManagement::class => null,
57-
Magento\Catalog\Model\Indexer\Product\Price\TableMaintainer::class => null,
58-
Magento\Catalog\Model\ResourceModel\Product\Indexer\Price\IndexTableStructureFactory::class => null,
59-
Magento\Catalog\Model\ResourceModel\Product\Attribute\Backend\Tierprice::class => null,
60-
Magento\Catalog\Model\ResourceModel\Product\Indexer\Price\TierPrice::class => null,
61-
Magento\Catalog\Model\ResourceModel\Product\Indexer\Price\CompositeProductBatchSizeAdjuster::class => null,
62-
Magento\Catalog\Model\ResourceModel\Product\Indexer\Price\BatchSizeCalculator::class => null,
63-
Magento\Catalog\Model\ResourceModel\Product\Attribute\Collection::class => null,
64-
Magento\Catalog\Model\Product\Attribute\Repository::class => null,
65-
Magento\Catalog\Model\ResourceModel\Product::class => null,
66-
Magento\Catalog\Model\ProductRepository::class => null,
67-
Magento\Catalog\Model\Product\Type::class => null,
68-
Magento\Catalog\Model\Product\Link::class => null,
69-
Magento\Customer\Model\Indexer\AttributeProvider::class => null,
39+
// Magento\Quote\Model\ResourceModel\Collection\Interceptor::class => null,
40+
// Magento\Quote\Model\ResourceModel\Quote\Collection\Interceptor::class => null,
41+
// Magento\Quote\Api\Data\ProductOptionInterfaceFactory::class => null,
42+
Magento\Quote\Model\Quote\Item\Interceptor::class => null, // FIXME
43+
Magento\Quote\Model\Quote\Address\Interceptor::class => null, // FIXME
44+
Magento\Quote\Model\ResourceModel\Quote::class => null, // FIXME
45+
// Magento\Quote\Model\QuoteIdToMaskedQuoteId::class => null,
46+
// Magento\Quote\Model\Quote\Address\Total\Collector::class => null,
47+
// Magento\Quote\Model\Quote\TotalsCollectorList::class => null,
48+
// Magento\Quote\Model\Quote\TotalsCollector::class => null,
49+
Magento\Quote\Model\Quote::class => null, // FIXME
50+
// Magento\Quote\Model\Quote\ProductOptionFactory::class => null,
51+
// Magento\Quote\Api\Data\ProductOptionExtensionFactory::class => null,
52+
// Magento\Catalog\Model\ResourceModel\Product\Indexer\Price\IndexTableRowSizeEstimator::class => null,
53+
// Magento\Catalog\Model\Indexer\Price\BatchSizeManagement::class => null,
54+
// Magento\Catalog\Model\ResourceModel\Product\Indexer\Price\DefaultPrice::class => null,
55+
// Magento\Catalog\Model\ResourceModel\Product\Indexer\Price\CompositeProductRelationsCalculator::class => null,
56+
// Magento\Catalog\Model\ResourceModel\Product\Indexer\Price\CompositeProductRowSizeEstimator::class => null,
57+
// Magento\Catalog\Model\Indexer\Price\CompositeProductBatchSizeManagement::class => null,
58+
// Magento\Catalog\Model\Indexer\Product\Price\TableMaintainer::class => null,
59+
// Magento\Catalog\Model\ResourceModel\Product\Indexer\Price\IndexTableStructureFactory::class => null,
60+
// Magento\Catalog\Model\ResourceModel\Product\Attribute\Backend\Tierprice::class => null,
61+
// Magento\Catalog\Model\ResourceModel\Product\Indexer\Price\TierPrice::class => null,
62+
// Magento\Catalog\Model\ResourceModel\Product\Indexer\Price\CompositeProductBatchSizeAdjuster::class => null,
63+
// Magento\Catalog\Model\ResourceModel\Product\Indexer\Price\BatchSizeCalculator::class => null,
64+
// Magento\Catalog\Model\ResourceModel\Product\Attribute\Collection::class => null,
65+
// Magento\Catalog\Model\Product\Attribute\Repository::class => null,
66+
// Magento\Catalog\Model\ResourceModel\Product::class => null,
67+
// Magento\Catalog\Model\ProductRepository::class => null,
68+
// Magento\Catalog\Model\Product\Type::class => null,
69+
// Magento\Catalog\Model\Product\Link::class => null,
70+
// Magento\Customer\Model\Indexer\AttributeProvider::class => null,
7071
Magento\Customer\Model\ResourceModel\Customer::class => null,
71-
Magento\Customer\Model\ResourceModel\CustomerRepository::class => null,
72-
Magento\Customer\Model\Session\Validators\CutoffValidator::class => null,
73-
Magento\Customer\Model\Customer::class => null,
74-
Magento\Customer\Model\Session\SessionCleaner::class => null,
75-
Magento\Customer\Model\ResourceModel\AddressRepository::class => null,
76-
Magento\Customer\Model\CustomerRegistry::class => null,
77-
Magento\Customer\Model\ResourceModel\Address\Relation::class => null,
78-
Magento\Customer\Model\ResourceModel\Address::class => null,
79-
Magento\Customer\Model\AttributeMetadataConverter::class => null,
80-
Magento\Customer\Model\Metadata\CustomerMetadata::class => null,
81-
Magento\Customer\Model\Metadata\AttributeMetadataCache::class => null,
82-
Magento\Customer\Model\Metadata\CustomerCachedMetadata::class => null,
83-
Magento\Customer\Model\Config\Share::class => null,
84-
Magento\Customer\Model\Session\Proxy::class => null,
85-
Magento\Customer\Model\Delegation\Storage::class => null,
86-
Magento\Customer\Model\ResourceModel\GroupRepository::class => null,
87-
Magento\Customer\Helper\View::class => null,
88-
Magento\Customer\Model\Authorization\CustomerSessionUserContext::class => null,
89-
Magento\Customer\Model\Authentication::class => null,
90-
Magento\Customer\Model\Session::class => null,
91-
Magento\Customer\Model\AddressRegistry::class => null,
92-
Magento\Customer\Model\AttributeMetadataDataProvider::class => null,
93-
Magento\Customer\Model\AccountConfirmation::class => null,
94-
Magento\Customer\Model\AccountManagement::class => null,
95-
Magento\Customer\Model\Plugin\CustomerFlushFormKey::class => null,
72+
Magento\Customer\Model\ResourceModel\Customer\Interceptor::class => null,
73+
// Magento\Customer\Model\ResourceModel\CustomerRepository::class => null,
74+
// Magento\Customer\Model\Session\Validators\CutoffValidator::class => null,
75+
// Magento\Customer\Model\Customer::class => null,
76+
// Magento\Customer\Model\Session\SessionCleaner::class => null,
77+
// Magento\Customer\Model\ResourceModel\AddressRepository::class => null,
78+
// Magento\Customer\Model\CustomerRegistry::class => null,
79+
// Magento\Customer\Model\ResourceModel\Address\Relation::class => null,
80+
// Magento\Customer\Model\ResourceModel\Address::class => null,
81+
// Magento\Customer\Model\AttributeMetadataConverter::class => null,
82+
Magento\Customer\Model\Metadata\CustomerMetadata::class => null, // TODO?
83+
// Magento\Customer\Model\Metadata\AttributeMetadataCache::class => null,
84+
// Magento\Customer\Model\Metadata\CustomerCachedMetadata::class => null,
85+
// Magento\Customer\Model\Config\Share::class => null,
86+
// Magento\Customer\Model\Session\Proxy::class => null,
87+
// Magento\Customer\Model\Delegation\Storage::class => null,
88+
// Magento\Customer\Model\ResourceModel\GroupRepository::class => null,
89+
// Magento\Customer\Helper\View::class => null,
90+
// Magento\Customer\Model\Authorization\CustomerSessionUserContext::class => null,
91+
// Magento\Customer\Model\Authentication::class => null,
92+
// Magento\Customer\Model\Session::class => null,
93+
// Magento\Customer\Model\AddressRegistry::class => null,
94+
// Magento\Customer\Model\AttributeMetadataDataProvider::class => null,
95+
// Magento\Customer\Model\AccountConfirmation::class => null,
96+
// Magento\Customer\Model\AccountManagement::class => null,
97+
// Magento\Customer\Model\Plugin\CustomerFlushFormKey::class => null,
9698
Magento\Customer\Observer\LogLastLoginAtObserver::class => null,
9799
Magento\Customer\Model\Visitor\Proxy::class => null,
98100
Magento\Customer\Api\CustomerRepositoryInterface\Proxy::class => null,
@@ -362,15 +364,15 @@
362364
Magento\Quote\Model\Cart\CustomerCartResolver::class => null,
363365
Magento\QuoteGraphQl\Model\Cart\CreateEmptyCartForGuest::class => null,
364366
Magento\Quote\Model\MaskedQuoteIdToQuoteId::class => null,
365-
Magento\Quote\Model\Quote\Address\Total\Shipping::class => null,
367+
Magento\Quote\Model\Quote\Address\Total\Shipping::class => null, // FIXME
366368
Magento\SalesRule\Model\Quote\Discount::class => null,
367369
Magento\Weee\Model\Total\Quote\Weee::class => null,
368-
Magento\Quote\Model\Quote\Interceptor::class => null,
370+
Magento\Quote\Model\Quote\Interceptor::class => null, // FIXME
369371
Magento\Quote\Model\ResourceModel\Quote\Address::class => null,
370-
Magento\Quote\Model\Quote\Address::class => null,
372+
Magento\Quote\Model\Quote\Address::class => null, // FIXME
371373
Magento\Quote\Model\ShippingMethodManagement::class => null,
372374
Magento\Quote\Model\ResourceModel\Quote\Item\Collection\Interceptor::class => null,
373-
Magento\Quote\Model\Quote\Address\Total::class => null,
375+
Magento\Quote\Model\Quote\Address\Total::class => null, // FIXME
374376
Laminas\Validator\ValidatorChain::class => null,
375377
Magento\CustomerCustomAttributes\Model\ResourceModel\Sales\Quote\Address::class => null,
376378
Magento\ResourceConnections\App\DeploymentConfig::class => null,
@@ -398,7 +400,7 @@
398400
Magento\Quote\Model\ShippingAssignment::class => null,
399401
Magento\Quote\Model\Shipping::class => null,
400402
Magento\NegotiableQuote\Model\NegotiableQuote\Interceptor::class => null,
401-
Magento\Quote\Api\Data\CartExtension::class => null,
403+
Magento\Quote\Api\Data\CartExtension::class => null, // FIXME
402404
Magento\Catalog\Api\Data\ProductExtension::class => null,
403405
Magento\Quote\Api\Data\AddressExtension::class => null,
404406
Magento\CatalogRule\Observer\ProcessFrontFinalPriceObserver\Interceptor::class => null,

0 commit comments

Comments
 (0)