Skip to content

Commit a9c51df

Browse files
committed
MAGNIMEX-15: phpcs changes
1 parent ea519ed commit a9c51df

File tree

2 files changed

+27
-10
lines changed

2 files changed

+27
-10
lines changed

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

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -876,7 +876,8 @@ protected function collectRawData()
876876
if ($this->_attributeTypes[$code] !== 'multiselect') {
877877
if (is_scalar($attrValue)) {
878878
if (!in_array($fieldName, $this->_getExportMainAttrCodes())) {
879-
$additionalAttributes[$fieldName] = $fieldName . ImportProduct::PAIR_NAME_VALUE_SEPARATOR . $attrValue;
879+
$additionalAttributes[$fieldName] = $fieldName .
880+
ImportProduct::PAIR_NAME_VALUE_SEPARATOR . $attrValue;
880881
}
881882
$data[$itemId][$storeId][$fieldName] = $attrValue;
882883
} else {
@@ -886,7 +887,8 @@ protected function collectRawData()
886887
}
887888

888889
if (!empty($additionalAttributes)) {
889-
$data[$itemId][$storeId][self::COL_ADDITIONAL_ATTRIBUTES] = implode(ImportProduct::DEFAULT_GLOBAL_MULTI_VALUE_SEPARATOR, $additionalAttributes);
890+
$data[$itemId][$storeId][self::COL_ADDITIONAL_ATTRIBUTES] =
891+
implode(ImportProduct::DEFAULT_GLOBAL_MULTI_VALUE_SEPARATOR, $additionalAttributes);
890892
} else {
891893
unset($data[$itemId][$storeId][self::COL_ADDITIONAL_ATTRIBUTES]);
892894
}
@@ -1024,7 +1026,8 @@ protected function addMultirowData($dataRow, $multiRawData)
10241026
foreach ($multiRawData['rowWebsites'][$productId] as $productWebsite) {
10251027
$websiteCodes[] = $this->_websiteIdToCode[$productWebsite];
10261028
}
1027-
$dataRow['_product_websites'] = implode(ImportProduct::DEFAULT_GLOBAL_MULTI_VALUE_SEPARATOR, $websiteCodes);
1029+
$dataRow['_product_websites'] =
1030+
implode(ImportProduct::DEFAULT_GLOBAL_MULTI_VALUE_SEPARATOR, $websiteCodes);
10281031
$multiRawData['rowWebsites'][$productId] = [];
10291032
}
10301033
if (!empty($multiRawData['mediaGalery'][$productId])) {
@@ -1034,8 +1037,10 @@ protected function addMultirowData($dataRow, $multiRawData)
10341037
$additionalImages[] = $mediaItem['_media_image'];
10351038
$additionalImageLabels[] = $mediaItem['_media_label'];
10361039
}
1037-
$dataRow['additional_images'] = implode(ImportProduct::DEFAULT_GLOBAL_MULTI_VALUE_SEPARATOR, $additionalImages);
1038-
$dataRow['additional_image_labels'] = implode(ImportProduct::DEFAULT_GLOBAL_MULTI_VALUE_SEPARATOR, $additionalImageLabels);
1040+
$dataRow['additional_images'] =
1041+
implode(ImportProduct::DEFAULT_GLOBAL_MULTI_VALUE_SEPARATOR, $additionalImages);
1042+
$dataRow['additional_image_labels'] =
1043+
implode(ImportProduct::DEFAULT_GLOBAL_MULTI_VALUE_SEPARATOR, $additionalImageLabels);
10391044
$multiRawData['mediaGalery'][$productId] = [];
10401045
}
10411046
foreach ($this->_linkTypeProvider->getLinkTypes() as $linkTypeName => $linkId) {
@@ -1045,15 +1050,17 @@ protected function addMultirowData($dataRow, $multiRawData)
10451050
$associations = [];
10461051
foreach ($multiRawData['linksRows'][$productId][$linkId] as $linkData) {
10471052
if ($linkData['default_qty'] !== null) {
1048-
$skuItem = $linkData['sku'] . ImportProduct::PAIR_NAME_VALUE_SEPARATOR . $linkData['default_qty'];
1053+
$skuItem = $linkData['sku'] . ImportProduct::PAIR_NAME_VALUE_SEPARATOR .
1054+
$linkData['default_qty'];
10491055
} else {
10501056
$skuItem = $linkData['sku'];
10511057
}
10521058
$associations[$skuItem] = $linkData['position'];
10531059
}
10541060
$multiRawData['linksRows'][$productId][$linkId] = [];
10551061
asort($associations);
1056-
$dataRow[$colPrefix . 'skus'] = implode(ImportProduct::DEFAULT_GLOBAL_MULTI_VALUE_SEPARATOR, array_keys($associations));
1062+
$dataRow[$colPrefix . 'skus'] =
1063+
implode(ImportProduct::DEFAULT_GLOBAL_MULTI_VALUE_SEPARATOR, array_keys($associations));
10571064
}
10581065
}
10591066
$dataRow = $this->rowCustomizer->addData($dataRow, $productId);
@@ -1063,7 +1070,10 @@ protected function addMultirowData($dataRow, $multiRawData)
10631070
if (!empty($this->collectedMultiselectsData[$storeId][$productId])) {
10641071
foreach (array_keys($this->collectedMultiselectsData[$storeId][$productId]) as $attrKey) {
10651072
if (!empty($this->collectedMultiselectsData[$storeId][$productId][$attrKey])) {
1066-
$dataRow[$attrKey] = implode(ImportProduct::DEFAULT_GLOBAL_MULTI_VALUE_SEPARATOR, $this->collectedMultiselectsData[$storeId][$productId][$attrKey]);
1073+
$dataRow[$attrKey] = implode(
1074+
ImportProduct::DEFAULT_GLOBAL_MULTI_VALUE_SEPARATOR,
1075+
$this->collectedMultiselectsData[$storeId][$productId][$attrKey]
1076+
);
10671077
}
10681078
}
10691079
}

app/code/Magento/CatalogImportExport/Test/Unit/Model/Export/ProductTest.php

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -384,7 +384,10 @@ public function testExportCountZeroBreakInternalCalls()
384384
$itemsPerPage = 10;
385385

386386
$this->product->expects($this->once())->method('getWriter')->willReturn($this->writer);
387-
$this->product->expects($this->exactly(1))->method('_getEntityCollection')->willReturn($this->abstractCollection);
387+
$this->product
388+
->expects($this->exactly(1))
389+
->method('_getEntityCollection')
390+
->willReturn($this->abstractCollection);
388391
$this->product->expects($this->once())->method('_prepareEntityCollection')->with($this->abstractCollection);
389392
$this->product->expects($this->once())->method('getItemsPerPage')->willReturn($itemsPerPage);
390393
$this->product->expects($this->once())->method('paginateCollection')->with($page, $itemsPerPage);
@@ -412,7 +415,10 @@ public function testExportCurPageEqualToLastBreakInternalCalls()
412415
$itemsPerPage = 10;
413416

414417
$this->product->expects($this->once())->method('getWriter')->willReturn($this->writer);
415-
$this->product->expects($this->exactly(1))->method('_getEntityCollection')->willReturn($this->abstractCollection);
418+
$this->product
419+
->expects($this->exactly(1))
420+
->method('_getEntityCollection')
421+
->willReturn($this->abstractCollection);
416422
$this->product->expects($this->once())->method('_prepareEntityCollection')->with($this->abstractCollection);
417423
$this->product->expects($this->once())->method('getItemsPerPage')->willReturn($itemsPerPage);
418424
$this->product->expects($this->once())->method('paginateCollection')->with($page, $itemsPerPage);
@@ -452,6 +458,7 @@ protected function tearDown()
452458
*
453459
* @param $object
454460
* @param $property
461+
* @return mixed
455462
*/
456463
protected function getPropertyValue($object, $property)
457464
{

0 commit comments

Comments
 (0)