Skip to content

Commit 79b2e5b

Browse files
author
Dmitry Kologrivov
committed
MAGNIMEX-151: phpcs for changes in andvanced prices
1 parent a2de59c commit 79b2e5b

File tree

2 files changed

+15
-10
lines changed

2 files changed

+15
-10
lines changed

app/code/Magento/AdvancedPricingImportExport/Model/Export/AdvancedPricing.php

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ class AdvancedPricing extends \Magento\CatalogImportExport\Model\Export\Product
3838
protected $_entityTypeCode;
3939

4040
/**
41-
* @var
41+
* @var \Magento\Framework\App\Resource
4242
*/
4343
protected $_resource;
4444

@@ -72,6 +72,11 @@ class AdvancedPricing extends \Magento\CatalogImportExport\Model\Export\Product
7272
ImportAdvancedPricing::COL_GROUP_PRICE_CUSTOMER_GROUP,
7373
];
7474

75+
/**
76+
* Template array for export data
77+
*
78+
* @var array
79+
*/
7580
protected $templateExportData = [
7681
ImportAdvancedPricing::COL_SKU => '',
7782
ImportAdvancedPricing::COL_GROUP_PRICE_WEBSITE => '',
@@ -298,7 +303,7 @@ protected function getExportData()
298303
}
299304

300305
/**
301-
* @param $exportData
306+
* @param array $exportData
302307
* @return array
303308
*/
304309
protected function correctExportData($exportData)
@@ -336,7 +341,7 @@ protected function correctExportData($exportData)
336341
* Get Tier and Group Pricing
337342
*
338343
* @param array $listSku
339-
* @param $table
344+
* @param string $table
340345
* @return array|bool
341346
*/
342347
protected function getTierAndGroupPrices(array $listSku, $table)
@@ -413,7 +418,7 @@ protected function getTierAndGroupPrices(array $listSku, $table)
413418
/**
414419
* Get Website code
415420
*
416-
* @param $websiteId
421+
* @param int $websiteId
417422
* @return string
418423
*/
419424
protected function _getWebsiteCode($websiteId)
@@ -434,7 +439,7 @@ protected function _getWebsiteCode($websiteId)
434439
/**
435440
* Get Customer Group By Id
436441
*
437-
* @param $customerGroupId
442+
* @param int $customerGroupId
438443
* @param null $allGroups
439444
* @return string
440445
*/

app/code/Magento/AdvancedPricingImportExport/Model/Import/AdvancedPricing.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -307,9 +307,7 @@ protected function saveAndReplaceAdvancedPrices()
307307
continue;
308308
}
309309
$rowSku = $rowData[self::COL_SKU];
310-
//if (\Magento\ImportExport\Model\Import::BEHAVIOR_REPLACE == $behavior) {
311-
$listSku[] = $rowSku;
312-
//}
310+
$listSku[] = $rowSku;
313311
if (!empty($rowData[self::COL_TIER_PRICE_WEBSITE])) {
314312
$tierPrices[$rowSku][] = [
315313
'all_groups' => $rowData[self::COL_TIER_PRICE_CUSTOMER_GROUP] == self::VALUE_ALL_GROUPS,
@@ -425,15 +423,17 @@ protected function deleteProductTierAndGroupPrices(array $listSku, $tableName)
425423
/**
426424
* Set updated_at for product
427425
*
428-
* @param $listSku
426+
* @param array $listSku
427+
* @return $this
429428
*/
430-
protected function setUpdatedAt($listSku)
429+
protected function setUpdatedAt(array $listSku)
431430
{
432431
$this->_connection->update(
433432
$this->_catalogProductEntity,
434433
[\Magento\Catalog\Model\Category::KEY_UPDATED_AT => date('Y-m-d H:i:s')],
435434
$this->_connection->quoteInto('sku IN (?)', $listSku)
436435
);
436+
return $this;
437437
}
438438

439439
/**

0 commit comments

Comments
 (0)