Skip to content

Commit 9aaf6c4

Browse files
committed
Code clenup
1 parent 1bcf00a commit 9aaf6c4

File tree

1 file changed

+28
-19
lines changed
  • app/code/Magento/Catalog/Model/Product

1 file changed

+28
-19
lines changed

app/code/Magento/Catalog/Model/Product/Type.php

Lines changed: 28 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,17 @@
55
*/
66
namespace Magento\Catalog\Model\Product;
77

8+
use Magento\Catalog\Api\Data\ProductInterface;
89
use Magento\Catalog\Model\Product;
10+
use Magento\Catalog\Model\Product\Type\AbstractType;
11+
use Magento\Catalog\Model\Product\Type\Pool;
12+
use Magento\Catalog\Model\Product\Type\Price;
13+
use Magento\Catalog\Model\Product\Type\Price\Factory as PriceFactory;
14+
use Magento\Catalog\Model\Product\Type\Simple;
15+
use Magento\Catalog\Model\ProductTypes\ConfigInterface;
916
use Magento\Framework\Data\OptionSourceInterface;
17+
use Magento\Framework\Pricing\PriceInfo\Factory as PriceInfoFactory;
18+
use Magento\Framework\Pricing\PriceInfoInterface;
1019

1120
/**
1221
* Product type model
@@ -34,15 +43,15 @@ class Type implements OptionSourceInterface
3443
/**
3544
* Default product type model
3645
*/
37-
const DEFAULT_TYPE_MODEL = \Magento\Catalog\Model\Product\Type\Simple::class;
46+
const DEFAULT_TYPE_MODEL = Simple::class;
3847

3948
/**
4049
* Default price model
4150
*/
42-
const DEFAULT_PRICE_MODEL = \Magento\Catalog\Model\Product\Type\Price::class;
51+
const DEFAULT_PRICE_MODEL = Price::class;
4352

4453
/**
45-
* @var \Magento\Catalog\Model\ProductTypes\ConfigInterface
54+
* @var ConfigInterface
4655
*/
4756
protected $_config;
4857

@@ -77,35 +86,35 @@ class Type implements OptionSourceInterface
7786
/**
7887
* Product type factory
7988
*
80-
* @var \Magento\Catalog\Model\Product\Type\Pool
89+
* @var Pool
8190
*/
8291
protected $_productTypePool;
8392

8493
/**
8594
* Price model factory
8695
*
87-
* @var \Magento\Catalog\Model\Product\Type\Price\Factory
96+
* @var PriceFactory
8897
*/
8998
protected $_priceFactory;
9099

91100
/**
92-
* @var \Magento\Framework\Pricing\PriceInfo\Factory
101+
* @var PriceInfoFactory
93102
*/
94103
protected $_priceInfoFactory;
95104

96105
/**
97106
* Construct
98107
*
99-
* @param \Magento\Catalog\Model\ProductTypes\ConfigInterface $config
100-
* @param \Magento\Catalog\Model\Product\Type\Pool $productTypePool
101-
* @param \Magento\Catalog\Model\Product\Type\Price\Factory $priceFactory
102-
* @param \Magento\Framework\Pricing\PriceInfo\Factory $priceInfoFactory
108+
* @param ConfigInterface $config
109+
* @param Pool $productTypePool
110+
* @param PriceFactory $priceFactory
111+
* @param PriceInfoFactory $priceInfoFactory
103112
*/
104113
public function __construct(
105-
\Magento\Catalog\Model\ProductTypes\ConfigInterface $config,
106-
\Magento\Catalog\Model\Product\Type\Pool $productTypePool,
107-
\Magento\Catalog\Model\Product\Type\Price\Factory $priceFactory,
108-
\Magento\Framework\Pricing\PriceInfo\Factory $priceInfoFactory
114+
ConfigInterface $config,
115+
Pool $productTypePool,
116+
PriceFactory $priceFactory,
117+
PriceInfoFactory $priceInfoFactory
109118
) {
110119
$this->_config = $config;
111120
$this->_productTypePool = $productTypePool;
@@ -116,8 +125,8 @@ public function __construct(
116125
/**
117126
* Factory to product singleton product type instances
118127
*
119-
* @param \Magento\Catalog\Api\Data\ProductInterface $product
120-
* @return \Magento\Catalog\Model\Product\Type\AbstractType
128+
* @param ProductInterface $product
129+
* @return AbstractType
121130
*/
122131
public function factory($product)
123132
{
@@ -139,8 +148,8 @@ public function factory($product)
139148
/**
140149
* Product type price model factory
141150
*
142-
* @param string $productType
143-
* @return \Magento\Catalog\Model\Product\Type\Price
151+
* @param string $productType
152+
* @return Price
144153
*/
145154
public function priceFactory($productType)
146155
{
@@ -164,7 +173,7 @@ public function priceFactory($productType)
164173
* Get Product Price Info object
165174
*
166175
* @param Product $saleableItem
167-
* @return \Magento\Framework\Pricing\PriceInfoInterface
176+
* @return PriceInfoInterface
168177
*/
169178
public function getPriceInfo(Product $saleableItem)
170179
{

0 commit comments

Comments
 (0)