Skip to content

Commit ddcfdec

Browse files
committed
Null assigment removed
1 parent 42d9406 commit ddcfdec

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

app/code/Magento/CatalogInventory/Block/Plugin/ProductView.php

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77

88
use Magento\Catalog\Block\Product\View;
99
use Magento\CatalogInventory\Model\Product\QuantityValidator;
10-
use Magento\Framework\App\ObjectManager;
1110

1211
class ProductView
1312
{
@@ -17,14 +16,12 @@ class ProductView
1716
private $productQuantityValidator;
1817

1918
/**
20-
* @param QuantityValidator|null $productQuantityValidator
19+
* @param QuantityValidator $productQuantityValidator
2120
*/
2221
public function __construct(
23-
QuantityValidator $productQuantityValidator = null
22+
QuantityValidator $productQuantityValidator
2423
) {
25-
$this->productQuantityValidator = $productQuantityValidator ?? ObjectManager::getInstance()->get(
26-
QuantityValidator::class
27-
);
24+
$this->productQuantityValidator = $productQuantityValidator;
2825
}
2926

3027
/**

0 commit comments

Comments
 (0)