Skip to content

Commit 01140b8

Browse files
ACPT-490
Fixing static tests
1 parent dd8ed67 commit 01140b8

File tree

2 files changed

+12
-7
lines changed

2 files changed

+12
-7
lines changed

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

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,10 @@ protected function _getProductAttributes($attrSetData)
267267
/**
268268
* Initialize attributes parameters for all attributes' sets.
269269
*
270+
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
271+
* @SuppressWarnings(PHPMD.NPathComplexity)
272+
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
273+
*
270274
* @return $this
271275
*/
272276
protected function _initAttributes()
@@ -311,16 +315,16 @@ protected function _initAttributes()
311315
$addedAttributes = array_merge(...$addedAttributes);
312316
$attributesToLoadFromTable = [];
313317
foreach ($addedAttributes as $addedAttribute) {
314-
if (isset($addedAttribute['options_use_table'])) {
318+
if (isset($addedAttribute['options_use_table'])) {
315319
$attributesToLoadFromTable[] = $addedAttribute['id'];
316-
unset(self::$commonAttributesCache[$addedAttribute['id']]['options_use_table']);
320+
unset(self::$commonAttributesCache[$addedAttribute['id']]['options_use_table']);
317321
}
318322
}
319323
if (!empty($attributesToLoadFromTable)) {
320324
$collection = $this->attributeOptionCollectionFactory->create();
321325
$collection->setAttributeFilter(['in' => $attributesToLoadFromTable]);
322326
$collection->setStoreFilter(\Magento\Store\Model\Store::DEFAULT_STORE_ID);
323-
foreach($collection as $option) {
327+
foreach ($collection as $option) {
324328
$attributeId = $option->getAttributeId();
325329
$value = strtolower($option->getValue());
326330
self::$commonAttributesCache[$attributeId]['options'][$value] = $option->getOptionId();
@@ -369,7 +373,7 @@ protected function attachAttributesById($attributeSetName, $attributeIds)
369373
['in' => $this->_forcedAttributesCodes]
370374
]
371375
) as $attribute) {
372-
$this->attachAttribute($attributeSetName, $attribute);
376+
$this->attachAttribute($attributeSetName, $attribute);
373377
}
374378
}
375379

@@ -417,13 +421,14 @@ private function attachAttributesByForcedCodes(string $attributeSetName) : array
417421
}
418422

419423
/**
420-
* Attach Attributes By Id
424+
* Attach Attribute to self::$commonAttributesCache or self::$invAttributesCache
421425
*
422426
* @param string $attributeSetName
423427
* @param ProductAttributeInterface $attribute
424428
* @return array|null
425429
*/
426-
private function attachAttribute(string $attributeSetName, ProductAttributeInterface $attribute) {
430+
private function attachAttribute(string $attributeSetName, ProductAttributeInterface $attribute)
431+
{
427432
$cachedAttribute = null;
428433
$attributeCode = $attribute->getAttributeCode();
429434
$attributeId = $attribute->getId();

app/code/Magento/ImportExport/Model/Import/Entity/AbstractEntity.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -442,7 +442,7 @@ protected function _saveValidatedBunches()
442442
* Workaround. Only way to implement dependency and not to break inherited child classes
443443
*
444444
* @return Json
445-
* @deprecated 100.2.0
445+
* @deprecated 100.2.0 It's just a workaround. It was never intended to be used.
446446
*/
447447
private function getSerializer()
448448
{

0 commit comments

Comments
 (0)