Skip to content

Commit c0a2062

Browse files
authored
Merge pull request #4114 from magento-trigger/MC-15995
- Revert change of PR 3766 - Fixed MC-16040 Fix data cleanup after test
2 parents ad779f2 + 696f8f5 commit c0a2062

File tree

29 files changed

+346
-534
lines changed

29 files changed

+346
-534
lines changed

app/code/Magento/Catalog/Model/ResourceModel/Category/Collection.php

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

88
use Magento\CatalogUrlRewrite\Model\CategoryUrlRewriteGenerator;
99
use Magento\Framework\App\Config\ScopeConfigInterface;
10-
use Magento\Framework\Model\ResourceModel\ResourceModelPoolInterface;
1110
use Magento\Store\Model\ScopeInterface;
1211

1312
/**
@@ -83,8 +82,6 @@ class Collection extends \Magento\Catalog\Model\ResourceModel\Collection\Abstrac
8382
* @param \Magento\Store\Model\StoreManagerInterface $storeManager
8483
* @param \Magento\Framework\DB\Adapter\AdapterInterface $connection
8584
* @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig
86-
*
87-
* @param ResourceModelPoolInterface|null $resourceModelPool
8885
* @SuppressWarnings(PHPMD.ExcessiveParameterList)
8986
*/
9087
public function __construct(
@@ -99,8 +96,7 @@ public function __construct(
9996
\Magento\Framework\Validator\UniversalFactory $universalFactory,
10097
\Magento\Store\Model\StoreManagerInterface $storeManager,
10198
\Magento\Framework\DB\Adapter\AdapterInterface $connection = null,
102-
\Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig = null,
103-
ResourceModelPoolInterface $resourceModelPool = null
99+
\Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig = null
104100
) {
105101
parent::__construct(
106102
$entityFactory,
@@ -113,8 +109,7 @@ public function __construct(
113109
$resourceHelper,
114110
$universalFactory,
115111
$storeManager,
116-
$connection,
117-
$resourceModelPool
112+
$connection
118113
);
119114
$this->scopeConfig = $scopeConfig ?:
120115
\Magento\Framework\App\ObjectManager::getInstance()->get(ScopeConfigInterface::class);

app/code/Magento/Catalog/Model/ResourceModel/Collection/AbstractCollection.php

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55
*/
66
namespace Magento\Catalog\Model\ResourceModel\Collection;
77

8-
use Magento\Framework\Model\ResourceModel\ResourceModelPoolInterface;
9-
108
/**
119
* Catalog EAV collection resource abstract model
1210
*
@@ -45,8 +43,6 @@ class AbstractCollection extends \Magento\Eav\Model\Entity\Collection\AbstractCo
4543
* @param \Magento\Framework\Validator\UniversalFactory $universalFactory
4644
* @param \Magento\Store\Model\StoreManagerInterface $storeManager
4745
* @param \Magento\Framework\DB\Adapter\AdapterInterface $connection
48-
*
49-
* @param ResourceModelPoolInterface|null $resourceModelPool
5046
* @SuppressWarnings(PHPMD.ExcessiveParameterList)
5147
*/
5248
public function __construct(
@@ -60,8 +56,7 @@ public function __construct(
6056
\Magento\Eav\Model\ResourceModel\Helper $resourceHelper,
6157
\Magento\Framework\Validator\UniversalFactory $universalFactory,
6258
\Magento\Store\Model\StoreManagerInterface $storeManager,
63-
\Magento\Framework\DB\Adapter\AdapterInterface $connection = null,
64-
ResourceModelPoolInterface $resourceModelPool = null
59+
\Magento\Framework\DB\Adapter\AdapterInterface $connection = null
6560
) {
6661
$this->_storeManager = $storeManager;
6762
parent::__construct(
@@ -74,8 +69,7 @@ public function __construct(
7469
$eavEntityFactory,
7570
$resourceHelper,
7671
$universalFactory,
77-
$connection,
78-
$resourceModelPool
72+
$connection
7973
);
8074
}
8175

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

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
use Magento\Store\Model\Store;
2222
use Magento\Catalog\Model\Indexer\Category\Product\TableMaintainer;
2323
use Magento\Framework\Indexer\DimensionFactory;
24-
use Magento\Framework\Model\ResourceModel\ResourceModelPoolInterface;
2524

2625
/**
2726
* Product collection
@@ -32,6 +31,7 @@
3231
* @SuppressWarnings(PHPMD.ExcessiveClassComplexity)
3332
* @SuppressWarnings(PHPMD.NumberOfChildren)
3433
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
34+
* @SuppressWarnings(PHPMD.CookieAndSessionMisuse)
3535
* @since 100.0.2
3636
*/
3737
class Collection extends \Magento\Catalog\Model\ResourceModel\Collection\AbstractCollection
@@ -324,7 +324,6 @@ class Collection extends \Magento\Catalog\Model\ResourceModel\Collection\Abstrac
324324
* @param TableMaintainer|null $tableMaintainer
325325
* @param PriceTableResolver|null $priceTableResolver
326326
* @param DimensionFactory|null $dimensionFactory
327-
* @param ResourceModelPoolInterface|null $resourceModelPool
328327
*
329328
* @SuppressWarnings(PHPMD.ExcessiveParameterList)
330329
*/
@@ -353,8 +352,7 @@ public function __construct(
353352
MetadataPool $metadataPool = null,
354353
TableMaintainer $tableMaintainer = null,
355354
PriceTableResolver $priceTableResolver = null,
356-
DimensionFactory $dimensionFactory = null,
357-
ResourceModelPoolInterface $resourceModelPool = null
355+
DimensionFactory $dimensionFactory = null
358356
) {
359357
$this->moduleManager = $moduleManager;
360358
$this->_catalogProductFlatState = $catalogProductFlatState;
@@ -382,8 +380,7 @@ public function __construct(
382380
$resourceHelper,
383381
$universalFactory,
384382
$storeManager,
385-
$connection,
386-
$resourceModelPool
383+
$connection
387384
);
388385
$this->tableMaintainer = $tableMaintainer ?: ObjectManager::getInstance()->get(TableMaintainer::class);
389386
$this->priceTableResolver = $priceTableResolver ?: ObjectManager::getInstance()->get(PriceTableResolver::class);
@@ -1979,6 +1976,7 @@ protected function _productLimitationPrice($joinLeft = false)
19791976
}
19801977
// Set additional field filters
19811978
foreach ($this->_priceDataFieldFilters as $filterData) {
1979+
// phpcs:ignore Magento2.Functions.DiscouragedFunction
19821980
$select->where(call_user_func_array('sprintf', $filterData));
19831981
}
19841982
} else {
@@ -2284,6 +2282,7 @@ private function getBackend()
22842282
public function addPriceDataFieldFilter($comparisonFormat, $fields)
22852283
{
22862284
if (!preg_match('/^%s( (<|>|=|<=|>=|<>) %s)*$/', $comparisonFormat)) {
2285+
// phpcs:ignore Magento2.Exceptions.DirectThrow
22872286
throw new \Exception('Invalid comparison format.');
22882287
}
22892288

app/code/Magento/Catalog/Model/ResourceModel/Product/Compare/Item/Collection.php

Lines changed: 3 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,14 @@
55
*/
66
namespace Magento\Catalog\Model\ResourceModel\Product\Compare\Item;
77

8-
use Magento\Catalog\Model\Indexer\Category\Product\TableMaintainer;
9-
use Magento\Catalog\Model\Indexer\Product\Price\PriceTableResolver;
10-
use Magento\Catalog\Model\ResourceModel\Product\Collection\ProductLimitationFactory;
11-
use Magento\Framework\EntityManager\MetadataPool;
12-
use Magento\Framework\Indexer\DimensionFactory;
13-
use Magento\Framework\Model\ResourceModel\ResourceModelPoolInterface;
14-
158
/**
169
* Catalog Product Compare Items Resource Collection
1710
*
1811
* @api
1912
* @author Magento Core Team <[email protected]>
2013
* @SuppressWarnings(PHPMD.LongVariable)
2114
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
15+
* @SuppressWarnings(PHPMD.CookieAndSessionMisuse)
2216
* @since 100.0.2
2317
*/
2418
class Collection extends \Magento\Catalog\Model\ResourceModel\Product\Collection
@@ -82,12 +76,6 @@ class Collection extends \Magento\Catalog\Model\ResourceModel\Product\Collection
8276
* @param \Magento\Catalog\Model\ResourceModel\Product\Compare\Item $catalogProductCompareItem
8377
* @param \Magento\Catalog\Helper\Product\Compare $catalogProductCompare
8478
* @param \Magento\Framework\DB\Adapter\AdapterInterface $connection
85-
* @param ProductLimitationFactory|null $productLimitationFactory
86-
* @param MetadataPool|null $metadataPool
87-
* @param TableMaintainer|null $tableMaintainer
88-
* @param PriceTableResolver|null $priceTableResolver
89-
* @param DimensionFactory|null $dimensionFactory
90-
* @param ResourceModelPoolInterface|null $resourceModelPool
9179
* @SuppressWarnings(PHPMD.ExcessiveParameterList)
9280
*/
9381
public function __construct(
@@ -112,13 +100,7 @@ public function __construct(
112100
\Magento\Customer\Api\GroupManagementInterface $groupManagement,
113101
\Magento\Catalog\Model\ResourceModel\Product\Compare\Item $catalogProductCompareItem,
114102
\Magento\Catalog\Helper\Product\Compare $catalogProductCompare,
115-
\Magento\Framework\DB\Adapter\AdapterInterface $connection = null,
116-
ProductLimitationFactory $productLimitationFactory = null,
117-
MetadataPool $metadataPool = null,
118-
TableMaintainer $tableMaintainer = null,
119-
PriceTableResolver $priceTableResolver = null,
120-
DimensionFactory $dimensionFactory = null,
121-
ResourceModelPoolInterface $resourceModelPool = null
103+
\Magento\Framework\DB\Adapter\AdapterInterface $connection = null
122104
) {
123105
$this->_catalogProductCompareItem = $catalogProductCompareItem;
124106
$this->_catalogProductCompare = $catalogProductCompare;
@@ -142,13 +124,7 @@ public function __construct(
142124
$customerSession,
143125
$dateTime,
144126
$groupManagement,
145-
$connection,
146-
$productLimitationFactory,
147-
$metadataPool,
148-
$tableMaintainer,
149-
$priceTableResolver,
150-
$dimensionFactory,
151-
$resourceModelPool
127+
$connection
152128
);
153129
}
154130

0 commit comments

Comments
 (0)