@@ -175,11 +175,11 @@ class Wishlist extends AbstractModel implements IdentityInterface
175
175
* @param Random $mathRandom
176
176
* @param DateTime $dateTime
177
177
* @param ProductRepositoryInterface $productRepository
178
- * @param StockItemRepository $stockItemRepository
179
- * @param ScopeConfigInterface|null $scopeConfig
180
178
* @param bool $useCurrentWebsite
181
179
* @param array $data
182
180
* @param Json|null $serializer
181
+ * @param StockItemRepository|null $stockItemRepository
182
+ * @param ScopeConfigInterface|null $scopeConfig
183
183
* @SuppressWarnings(PHPMD.ExcessiveParameterList)
184
184
*/
185
185
public function __construct (
@@ -197,11 +197,11 @@ public function __construct(
197
197
Random $ mathRandom ,
198
198
DateTime $ dateTime ,
199
199
ProductRepositoryInterface $ productRepository ,
200
- StockItemRepository $ stockItemRepository ,
201
- ScopeConfigInterface $ scopeConfig = null ,
202
200
$ useCurrentWebsite = true ,
203
201
array $ data = [],
204
- Json $ serializer = null
202
+ Json $ serializer = null ,
203
+ StockItemRepository $ stockItemRepository = null ,
204
+ ScopeConfigInterface $ scopeConfig = null
205
205
) {
206
206
$ this ->_useCurrentWebsite = $ useCurrentWebsite ;
207
207
$ this ->_catalogProduct = $ catalogProduct ;
@@ -216,7 +216,9 @@ public function __construct(
216
216
$ this ->serializer = $ serializer ?: ObjectManager::getInstance ()->get (Json::class);
217
217
parent ::__construct ($ context , $ registry , $ resource , $ resourceCollection , $ data );
218
218
$ this ->productRepository = $ productRepository ;
219
- $ this ->stockItemRepository = $ stockItemRepository ;
219
+ $ this ->stockItemRepository = $ stockItemRepository ?: ObjectManager::getInstance ()->get (
220
+ StockItemRepository::class
221
+ );
220
222
$ this ->scopeConfig = $ scopeConfig ?: ObjectManager::getInstance ()->get (ScopeConfigInterface::class);
221
223
}
222
224
0 commit comments