Skip to content

Commit b6784b5

Browse files
committed
#22382: Static test fix.
1 parent bfc82b6 commit b6784b5

File tree

2 files changed

+7
-1
lines changed
  • app/code/Magento/CatalogImportExport/Model/Import
  • dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/Import

2 files changed

+7
-1
lines changed

app/code/Magento/CatalogImportExport/Model/Import/Product.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1247,6 +1247,7 @@ protected function _prepareRowForDb(array $rowData)
12471247
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
12481248
* @SuppressWarnings(PHPMD.NPathComplexity)
12491249
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
1250+
* phpcs:disable Generic.Metrics.NestingLevel
12501251
*/
12511252
protected function _saveLinks()
12521253
{
@@ -1256,7 +1257,7 @@ protected function _saveLinks()
12561257
$nextLinkId = $this->_resourceHelper->getNextAutoincrement($mainTable);
12571258

12581259
// pre-load 'position' attributes ID for each link type once
1259-
foreach ($this->_linkNameToId as $linkName => $linkId) {
1260+
foreach ($this->_linkNameToId as $linkId) {
12601261
$select = $this->_connection->select()->from(
12611262
$resource->getTable('catalog_product_link_attribute'),
12621263
['id' => 'product_link_attribute_id']
@@ -1374,6 +1375,7 @@ protected function _saveLinks()
13741375
}
13751376
return $this;
13761377
}
1378+
// phpcs:enable
13771379

13781380
/**
13791381
* Save product attributes.
@@ -1608,6 +1610,7 @@ public function getImagesFromRow(array $rowData)
16081610
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
16091611
* @SuppressWarnings(PHPMD.UnusedLocalVariable)
16101612
* @throws LocalizedException
1613+
* phpcs:disable Generic.Metrics.NestingLevel
16111614
*/
16121615
protected function _saveProducts()
16131616
{
@@ -1980,6 +1983,7 @@ protected function _saveProducts()
19801983

19811984
return $this;
19821985
}
1986+
// phpcs:enable
19831987

19841988
/**
19851989
* Prepare array with image states (visible or hidden from product page)

dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/Import/ProductTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
* @magentoDataFixtureBeforeTransaction Magento/Catalog/_files/enable_catalog_product_reindex_schedule.php
3535
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
3636
* @SuppressWarnings(PHPMD.ExcessiveClassComplexity)
37+
* phpcs:disable Generic.PHP.NoSilencedErrors, Generic.Metrics.NestingLevel, Magento2.Functions.StaticFunction
3738
*/
3839
class ProductTest extends \Magento\TestFramework\Indexer\TestCase
3940
{
@@ -1820,6 +1821,7 @@ function (ProductInterface $item) {
18201821
if ($product->getId()) {
18211822
$productRepository->delete($product);
18221823
}
1824+
// phpcs:ignore Magento2.CodeAnalysis.EmptyBlock
18231825
} catch (\Magento\Framework\Exception\NoSuchEntityException $e) {
18241826
//Product already removed
18251827
}

0 commit comments

Comments
 (0)