14
14
use Magento \Framework \App \Filesystem \DirectoryList ;
15
15
use Magento \Framework \App \ObjectManager ;
16
16
use Magento \Framework \Image as MagentoImage ;
17
+ use Magento \Catalog \Model \View \Asset \ImageFactory ;
17
18
18
19
/**
19
20
* @SuppressWarnings(PHPMD.TooManyFields)
@@ -216,8 +217,8 @@ public function __construct(
216
217
\Magento \Framework \App \Config \ScopeConfigInterface $ scopeConfig ,
217
218
\Magento \Framework \Model \ResourceModel \AbstractResource $ resource = null ,
218
219
\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
221
222
) {
222
223
$ this ->_storeManager = $ storeManager ;
223
224
$ this ->_catalogProductMediaConfig = $ catalogProductMediaConfig ;
@@ -228,13 +229,8 @@ public function __construct(
228
229
$ this ->_assetRepo = $ assetRepo ;
229
230
$ this ->_viewFileSystem = $ viewFileSystem ;
230
231
$ 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);
238
234
}
239
235
240
236
/**
0 commit comments