Skip to content

Commit 1fe8351

Browse files
Conform more to modern coding standards as requested.
1 parent 840dcda commit 1fe8351

File tree

1 file changed

+5
-9
lines changed
  • app/code/Magento/Catalog/Model/Product

1 file changed

+5
-9
lines changed

app/code/Magento/Catalog/Model/Product/Image.php

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
use Magento\Framework\App\Filesystem\DirectoryList;
1515
use Magento\Framework\App\ObjectManager;
1616
use Magento\Framework\Image as MagentoImage;
17+
use Magento\Catalog\Model\View\Asset\ImageFactory;
1718

1819
/**
1920
* @SuppressWarnings(PHPMD.TooManyFields)
@@ -216,8 +217,8 @@ public function __construct(
216217
\Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig,
217218
\Magento\Framework\Model\ResourceModel\AbstractResource $resource = null,
218219
\Magento\Framework\Data\Collection\AbstractDb $resourceCollection = null,
219-
\Magento\Catalog\Model\View\Asset\ImageFactory $viewAssetImageFactory = null,
220-
array $data = []
220+
array $data = [],
221+
ImageFactory $viewAssetImageFactory = null
221222
) {
222223
$this->_storeManager = $storeManager;
223224
$this->_catalogProductMediaConfig = $catalogProductMediaConfig;
@@ -228,13 +229,8 @@ public function __construct(
228229
$this->_assetRepo = $assetRepo;
229230
$this->_viewFileSystem = $viewFileSystem;
230231
$this->_scopeConfig = $scopeConfig;
231-
if ($viewAssetImageFactory == null) {
232-
$this->viewAssetImageFactory = ObjectManager::getInstance()->get(
233-
\Magento\Catalog\Model\View\Asset\ImageFactory::class
234-
);
235-
} else {
236-
$this->viewAssetImageFactory = $viewAssetImageFactory;
237-
}
232+
$this->viewAssetImageFactory = $viewAssetImageFactory
233+
?: ObjectManager::getInstance()->get(ImageFactory::class);
238234
}
239235

240236
/**

0 commit comments

Comments
 (0)