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 5
5
*/
6
6
namespace Magento \CatalogInventory \Block \Plugin ;
7
7
8
+ use Magento \Catalog \Block \Product \View ;
8
9
use Magento \CatalogInventory \Model \Product \QuantityValidator ;
9
- use Magento \Framework \App \ObjectManager ;
10
10
11
11
class ProductView
12
12
{
@@ -16,25 +16,23 @@ class ProductView
16
16
private $ productQuantityValidator ;
17
17
18
18
/**
19
- * @param QuantityValidator|null $productQuantityValidator
19
+ * @param QuantityValidator $productQuantityValidator
20
20
*/
21
21
public function __construct (
22
- QuantityValidator $ productQuantityValidator = null
22
+ QuantityValidator $ productQuantityValidator
23
23
) {
24
- $ this ->productQuantityValidator = $ productQuantityValidator ?: ObjectManager::getInstance ()->get (
25
- QuantityValidator::class
26
- );
24
+ $ this ->productQuantityValidator = $ productQuantityValidator ;
27
25
}
28
26
29
27
/**
30
28
* Adds quantities validator.
31
29
*
32
- * @param \Magento\Catalog\Block\Product\ View $block
30
+ * @param View $block
33
31
* @param array $validators
34
32
* @return array
35
33
*/
36
34
public function afterGetQuantityValidators (
37
- \ Magento \ Catalog \ Block \ Product \ View $ block ,
35
+ View $ block ,
38
36
array $ validators
39
37
) {
40
38
return array_merge (
Original file line number Diff line number Diff line change 8
8
"php" : " ~8.2.0||~8.3.0||~8.4.0" ,
9
9
"magento/framework" : " *" ,
10
10
"magento/module-catalog" : " *" ,
11
- "magento/module-inventory-configuration-api" : " *" ,
12
- "magento/module-inventory-sales-api" : " *" ,
13
11
"magento/module-config" : " *" ,
14
12
"magento/module-customer" : " *" ,
15
13
"magento/module-eav" : " *" ,
You can’t perform that action at this time.
0 commit comments