File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
app/code/Magento/CatalogInventory/Model/Quote/Item/QuantityValidator/Initializer Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change 10
10
use Magento \CatalogInventory \Api \Data \StockItemInterface ;
11
11
use Magento \CatalogInventory \Model \Quote \Item \QuantityValidator \QuoteItemQtyList ;
12
12
use Magento \CatalogInventory \Model \Spi \StockStateProviderInterface ;
13
+ use Magento \Framework \App \ObjectManager ;
13
14
use Magento \Quote \Model \Quote \Item ;
14
15
15
16
/**
@@ -41,18 +42,19 @@ class StockItem
41
42
* @param ConfigInterface $typeConfig
42
43
* @param QuoteItemQtyList $quoteItemQtyList
43
44
* @param StockStateInterface $stockState
44
- * @param StockStateProviderInterface $stockStateProvider
45
+ * @param StockStateProviderInterface|null $stockStateProvider
45
46
*/
46
47
public function __construct (
47
48
ConfigInterface $ typeConfig ,
48
49
QuoteItemQtyList $ quoteItemQtyList ,
49
50
StockStateInterface $ stockState ,
50
- StockStateProviderInterface $ stockStateProvider
51
+ StockStateProviderInterface $ stockStateProvider = null
51
52
) {
52
53
$ this ->quoteItemQtyList = $ quoteItemQtyList ;
53
54
$ this ->typeConfig = $ typeConfig ;
54
55
$ this ->stockState = $ stockState ;
55
- $ this ->stockStateProvider = $ stockStateProvider ;
56
+ $ this ->stockStateProvider = $ stockStateProvider ?: ObjectManager::getInstance ()
57
+ ->get (StockStateProviderInterface::class);
56
58
}
57
59
58
60
/**
You can’t perform that action at this time.
0 commit comments