File tree Expand file tree Collapse file tree 2 files changed +6
-10
lines changed
app/code/Magento/CatalogInventory Expand file tree Collapse file tree 2 files changed +6
-10
lines changed Original file line number Diff line number Diff line change 55 */
66namespace Magento \CatalogInventory \Block \Plugin ;
77
8+ use Magento \Catalog \Block \Product \View ;
89use Magento \CatalogInventory \Model \Product \QuantityValidator ;
9- use Magento \Framework \App \ObjectManager ;
1010
1111class ProductView
1212{
@@ -16,25 +16,23 @@ class ProductView
1616 private $ productQuantityValidator ;
1717
1818 /**
19- * @param QuantityValidator|null $productQuantityValidator
19+ * @param QuantityValidator $productQuantityValidator
2020 */
2121 public function __construct (
22- QuantityValidator $ productQuantityValidator = null
22+ QuantityValidator $ productQuantityValidator
2323 ) {
24- $ this ->productQuantityValidator = $ productQuantityValidator ?: ObjectManager::getInstance ()->get (
25- QuantityValidator::class
26- );
24+ $ this ->productQuantityValidator = $ productQuantityValidator ;
2725 }
2826
2927 /**
3028 * Adds quantities validator.
3129 *
32- * @param \Magento\Catalog\Block\Product\ View $block
30+ * @param View $block
3331 * @param array $validators
3432 * @return array
3533 */
3634 public function afterGetQuantityValidators (
37- \ Magento \ Catalog \ Block \ Product \ View $ block ,
35+ View $ block ,
3836 array $ validators
3937 ) {
4038 return array_merge (
Original file line number Diff line number Diff line change 88 "php" : " ~8.2.0||~8.3.0||~8.4.0" ,
99 "magento/framework" : " *" ,
1010 "magento/module-catalog" : " *" ,
11- "magento/module-inventory-configuration-api" : " *" ,
12- "magento/module-inventory-sales-api" : " *" ,
1311 "magento/module-config" : " *" ,
1412 "magento/module-customer" : " *" ,
1513 "magento/module-eav" : " *" ,
You can’t perform that action at this time.
0 commit comments