Skip to content

Commit 00750f4

Browse files
fix static
1 parent 2324cdd commit 00750f4

File tree

1 file changed

+24
-16
lines changed

1 file changed

+24
-16
lines changed

app/code/Magento/Catalog/Model/CategoryLinkRepository.php

Lines changed: 24 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -6,44 +6,52 @@
66

77
namespace Magento\Catalog\Model;
88

9-
use Magento\Framework\Exception\InputException;
9+
use Magento\Catalog\Api\CategoryLinkRepositoryInterface;
10+
use Magento\Catalog\Api\CategoryListDeleteBySkuInterface;
11+
use Magento\Catalog\Api\CategoryRepositoryInterface;
12+
use Magento\Catalog\Api\ProductRepositoryInterface;
13+
use Magento\Catalog\Model\ResourceModel\Product;
14+
use Magento\Framework\App\ObjectManager;
1015
use Magento\Framework\Exception\CouldNotSaveException;
16+
use Magento\Framework\Exception\InputException;
1117

12-
class CategoryLinkRepository implements \Magento\Catalog\Api\CategoryLinkRepositoryInterface,
13-
\Magento\Catalog\Api\CategoryListDeleteBySkuInterface
18+
/**
19+
* @inheritdoc
20+
*/
21+
class CategoryLinkRepository implements CategoryLinkRepositoryInterface, CategoryListDeleteBySkuInterface
1422
{
1523
/**
1624
* @var CategoryRepository
1725
*/
1826
protected $categoryRepository;
1927

2028
/**
21-
* @var \Magento\Catalog\Api\ProductRepositoryInterface
29+
* @var ProductRepositoryInterface
2230
*/
2331
protected $productRepository;
2432

2533
/**
26-
* @var \Magento\Catalog\Model\ResourceModel\Product
34+
* @var Product
2735
*/
2836
private $productResource;
2937

3038
/**
31-
* @param \Magento\Catalog\Api\CategoryRepositoryInterface $categoryRepository
32-
* @param \Magento\Catalog\Api\ProductRepositoryInterface $productRepository
33-
* @param \Magento\Catalog\Model\ResourceModel\Product $productResource
39+
* @param CategoryRepositoryInterface $categoryRepository
40+
* @param ProductRepositoryInterface $productRepository
41+
* @param Product $productResource
3442
*/
3543
public function __construct(
36-
\Magento\Catalog\Api\CategoryRepositoryInterface $categoryRepository,
37-
\Magento\Catalog\Api\ProductRepositoryInterface $productRepository,
38-
\Magento\Catalog\Model\ResourceModel\Product $productResource = null
44+
CategoryRepositoryInterface $categoryRepository,
45+
ProductRepositoryInterface $productRepository,
46+
Product $productResource = null
3947
) {
4048
$this->categoryRepository = $categoryRepository;
4149
$this->productRepository = $productRepository;
42-
$this->productResource = $productResource ?? \Magento\Framework\App\ObjectManager::getInstance()->get(\Magento\Catalog\Model\ResourceModel\Product::class);
50+
$this->productResource = $productResource ?? ObjectManager::getInstance()->get(Product::class);
4351
}
4452

4553
/**
46-
* {@inheritdoc}
54+
* @inheritdoc
4755
*/
4856
public function save(\Magento\Catalog\Api\Data\CategoryProductLinkInterface $productLink)
4957
{
@@ -69,15 +77,15 @@ public function save(\Magento\Catalog\Api\Data\CategoryProductLinkInterface $pro
6977
}
7078

7179
/**
72-
* {@inheritdoc}
80+
* @inheritdoc
7381
*/
7482
public function delete(\Magento\Catalog\Api\Data\CategoryProductLinkInterface $productLink)
7583
{
7684
return $this->deleteByIds($productLink->getCategoryId(), $productLink->getSku());
7785
}
7886

7987
/**
80-
* {@inheritdoc}
88+
* @inheritdoc
8189
*/
8290
public function deleteByIds($categoryId, $sku)
8391
{
@@ -112,7 +120,7 @@ public function deleteByIds($categoryId, $sku)
112120
}
113121

114122
/**
115-
* {@inheritDoc}
123+
* @inheritdoc
116124
*/
117125
public function deleteBySkus(int $categoryId, array $productSkuList): bool
118126
{

0 commit comments

Comments
 (0)