UpsellAjax   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
dl 0
loc 14
c 0
b 0
f 0
wmc 2
lcom 0
cbo 0
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A execute() 0 11 2
1
<?php
2
3
namespace Richdynamix\PersonalisedProducts\Controller\Products;
4
5
use Magento\Review\Controller\Product as ProductController;
6
use Magento\Framework\Controller\ResultFactory;
7
8
/**
9
 * Class UpsellAjax
10
 *
11
 * @category  Richdynamix
12
 * @package   PersonalisedProducts
13
 * @author    Steven Richardson ([email protected]) @mage_gizmo
14
 */
15
class UpsellAjax extends ProductController
16
{
17
    public function execute()
18
    {
19
        $productId = (int) $this->getRequest()->getParam('id');
20
        $product = $this->loadProduct($productId);
21
        if (!$product) {
22
            return false;
23
        }
24
        /** @var \Magento\Framework\View\Result\Layout $resultLayout */
25
        $resultLayout = $this->resultFactory->create(ResultFactory::TYPE_LAYOUT);
26
        return $resultLayout;
27
    }
28
}