Skip to content

Commit 992b3a1

Browse files
author
Marius Grad
committed
use FQCN throughout the class
1 parent cbda7b8 commit 992b3a1

File tree

1 file changed

+24
-21
lines changed

1 file changed

+24
-21
lines changed

app/code/Magento/Catalog/Block/Product/ListProduct.php

Lines changed: 24 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,19 @@
77
namespace Magento\Catalog\Block\Product;
88

99
use Magento\Catalog\Api\CategoryRepositoryInterface;
10-
use Magento\Catalog\Block\Product\Context;
1110
use Magento\Catalog\Block\Product\ProductList\Toolbar;
1211
use Magento\Catalog\Model\Category;
12+
use Magento\Catalog\Model\Layer;
1313
use Magento\Catalog\Model\Layer\Resolver;
1414
use Magento\Catalog\Model\Product;
1515
use Magento\Catalog\Model\ResourceModel\Product\Collection;
16+
use Magento\Catalog\Pricing\Price\FinalPrice;
1617
use Magento\Eav\Model\Entity\Collection\AbstractCollection;
18+
use Magento\Framework\App\ActionInterface;
1719
use Magento\Framework\Data\Helper\PostHelper;
1820
use Magento\Framework\DataObject\IdentityInterface;
1921
use Magento\Framework\Exception\NoSuchEntityException;
22+
use Magento\Framework\Pricing\Render;
2023
use Magento\Framework\Url\Helper\Data;
2124

2225
/**
@@ -64,11 +67,11 @@ class ListProduct extends AbstractProduct implements IdentityInterface
6467
protected $categoryRepository;
6568

6669
/**
67-
* @param \Magento\Catalog\Block\Product\Context $context
68-
* @param \Magento\Framework\Data\Helper\PostHelper $postDataHelper
69-
* @param \Magento\Catalog\Model\Layer\Resolver $layerResolver
70-
* @param \Magento\Catalog\Api\CategoryRepositoryInterface $categoryRepository
71-
* @param \Magento\Framework\Url\Helper\Data $urlHelper
70+
* @param Context $context
71+
* @param PostHelper $postDataHelper
72+
* @param Resolver $layerResolver
73+
* @param CategoryRepositoryInterface $categoryRepository
74+
* @param Data $urlHelper
7275
* @param array $data
7376
*/
7477
public function __construct(
@@ -117,7 +120,7 @@ protected function _getProductCollection()
117120
/**
118121
* Get catalog layer model
119122
*
120-
* @return \Magento\Catalog\Model\Layer
123+
* @return Layer
121124
*/
122125
public function getLayer()
123126
{
@@ -191,7 +194,7 @@ protected function _beforeToHtml()
191194
/**
192195
* Add toolbar block from product listing layout
193196
*
194-
* @param \Magento\Catalog\Model\ResourceModel\Product\Collection $collection
197+
* @param Collection $collection
195198
*/
196199
private function addToolbarBlock(Collection $collection)
197200
{
@@ -267,7 +270,7 @@ public function setCollection($collection)
267270
}
268271

269272
/**
270-
* @param array|string|integer|\Magento\Framework\App\Config\Element $code
273+
* @param array|string|integer|Element $code
271274
* @return $this
272275
*/
273276
public function addAttribute($code)
@@ -287,7 +290,7 @@ public function getPriceBlockTemplate()
287290
/**
288291
* Retrieve Catalog Config object
289292
*
290-
* @return \Magento\Catalog\Model\Config
293+
* @return Config
291294
*/
292295
protected function _getConfig()
293296
{
@@ -297,10 +300,10 @@ protected function _getConfig()
297300
/**
298301
* Prepare Sort By fields from Category Data
299302
*
300-
* @param \Magento\Catalog\Model\Category $category
301-
* @return \Magento\Catalog\Block\Product\ListProduct
303+
* @param Category $category
304+
* @return $this
302305
*/
303-
public function prepareSortableFieldsByCategory($category)
306+
public function prepareSortableFieldsByCategory(Category $category)
304307
{
305308
if (!$this->getAvailableOrders()) {
306309
$this->setAvailableOrders($category->getAvailableSortByOptions());
@@ -342,38 +345,38 @@ public function getIdentities()
342345
/**
343346
* Get post parameters
344347
*
345-
* @param \Magento\Catalog\Model\Product $product
348+
* @param Product $product
346349
* @return string
347350
*/
348-
public function getAddToCartPostParams(\Magento\Catalog\Model\Product $product)
351+
public function getAddToCartPostParams(Product $product)
349352
{
350353
$url = $this->getAddToCartUrl($product);
351354
return [
352355
'action' => $url,
353356
'data' => [
354357
'product' => $product->getEntityId(),
355-
\Magento\Framework\App\ActionInterface::PARAM_NAME_URL_ENCODED => $this->urlHelper->getEncodedUrl($url),
358+
ActionInterface::PARAM_NAME_URL_ENCODED => $this->urlHelper->getEncodedUrl($url),
356359
]
357360
];
358361
}
359362

360363
/**
361-
* @param \Magento\Catalog\Model\Product $product
364+
* @param Product $product
362365
* @return string
363366
*/
364-
public function getProductPrice(\Magento\Catalog\Model\Product $product)
367+
public function getProductPrice(Product $product)
365368
{
366369
$priceRender = $this->getPriceRender();
367370

368371
$price = '';
369372
if ($priceRender) {
370373
$price = $priceRender->render(
371-
\Magento\Catalog\Pricing\Price\FinalPrice::PRICE_CODE,
374+
FinalPrice::PRICE_CODE,
372375
$product,
373376
[
374377
'include_container' => true,
375378
'display_minimal_price' => true,
376-
'zone' => \Magento\Framework\Pricing\Render::ZONE_ITEM_LIST,
379+
'zone' => Render::ZONE_ITEM_LIST,
377380
'list_category_page' => true
378381
]
379382
);
@@ -386,7 +389,7 @@ public function getProductPrice(\Magento\Catalog\Model\Product $product)
386389
* Specifies that price rendering should be done for the list of products
387390
* i.e. rendering happens in the scope of product list, but not single product
388391
*
389-
* @return \Magento\Framework\Pricing\Render
392+
* @return Render
390393
*/
391394
protected function getPriceRender()
392395
{

0 commit comments

Comments
 (0)