Skip to content

Commit ea519ed

Browse files
committed
MAGNIMEX-145: code style chanages
1 parent 69dcf98 commit ea519ed

File tree

1 file changed

+7
-8
lines changed
  • app/code/Magento/CatalogImportExport/Model/Import

1 file changed

+7
-8
lines changed

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

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010

1111
use Magento\Framework\App\Filesystem\DirectoryList;
1212
use Magento\CatalogImportExport\Model\Import\Product\RowValidatorInterface as ValidatorInterface;
13-
use Magento\Framework\File\Uploader;
1413
use Magento\Framework\Model\Resource\Db\TransactionManagerInterface;
1514
use Magento\Framework\Model\Resource\Db\ObjectRelationProcessor;
1615
use Magento\Framework\Stdlib\DateTime;
@@ -1354,23 +1353,23 @@ protected function _saveProducts()
13541353
}
13551354

13561355
// 5. Media gallery phase
1357-
$dispertionPath = Uploader::getDispretionPath($rowData[self::COL_MEDIA_IMAGE]);
1356+
$dispertionPath = \Magento\Framework\File\Uploader::getDispretionPath($rowData[self::COL_MEDIA_IMAGE]);
13581357
$imageName = preg_replace('/[^a-z0-9\._-]+/i','', $rowData[self::COL_MEDIA_IMAGE]);
13591358
$fullDispertionPath = $dispertionPath.'/'.$imageName;
13601359
$imageIsSet = null;
13611360
$imageFromProduct = null;
13621361
$imageInProductIsSet = null;
1363-
foreach($this->cachedImages as $image) {
1364-
if($image['sku'] == $rowData[self::COL_SKU] && preg_replace('/_[0-9]+/','', $image['value']) == $fullDispertionPath) {
1362+
foreach ($this->cachedImages as $image) {
1363+
if ($image['sku'] == $rowData[self::COL_SKU] && preg_replace('/_[0-9]+/', '', $image['value']) == $fullDispertionPath) {
13651364
$imageInProductIsSet = true;
1366-
$imageFromProduct = preg_replace('/_[0-9]+/','', $image['value']);
1365+
$imageFromProduct = preg_replace('/_[0-9]+/', '', $image['value']);
13671366
break;
1368-
} elseif(in_array($fullDispertionPath, $image)) {
1367+
} elseif (in_array($fullDispertionPath, $image)) {
13691368
$imageIsSet = true;
13701369
break;
13711370
}
13721371
}
1373-
if( ($imageInProductIsSet && $imageFromProduct != $fullDispertionPath) || (!isset($imageIsSet) && !isset($imageInProductIsSet)) ) {
1372+
if (($imageInProductIsSet && $imageFromProduct != $fullDispertionPath) || (!isset($imageIsSet) && !isset($imageInProductIsSet))) {
13741373
$mediaGalleryImages = array();
13751374
$mediaGalleryLabels = array();
13761375
if (!empty($rowData[self::COL_MEDIA_IMAGE])) {
@@ -1419,7 +1418,7 @@ protected function _saveProducts()
14191418
];
14201419
}
14211420
}
1422-
} elseif($imageInProductIsSet && $imageFromProduct == $fullDispertionPath) {
1421+
} elseif ($imageInProductIsSet && $imageFromProduct == $fullDispertionPath) {
14231422
$mediaGalleryImages = array();
14241423
$mediaGalleryLabels = array();
14251424
if (!empty($rowData[self::COL_MEDIA_IMAGE])) {

0 commit comments

Comments
 (0)