NewAction   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
dl 0
loc 29
c 0
b 0
f 0
wmc 2
lcom 1
cbo 1
ccs 0
cts 12
cp 0
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 7 1
A execute() 0 6 1
1
<?php
2
/**
3
 * File: NewAction.php
4
 *
5
 * @author      Maciej Sławik <[email protected]>
6
 * Github:      https://github.com/maciejslawik
7
 */
8
9
namespace MSlwk\ICatalogue\Controller\Adminhtml\Catalogue;
10
11
use Magento\Backend\App\Action\Context;
12
use Magento\Backend\Model\View\Result\Forward;
13
use Magento\Backend\Model\View\Result\ForwardFactory;
14
15
/**
16
 * Class NewAction
17
 *
18
 * @package MSlwk\ICatalogue\Controller\Adminhtml\Catalogue
19
 */
20
class NewAction extends ActionAbstract
21
{
22
    /**
23
     * @var Forward
24
     */
25
    protected $resultForwardFactory;
26
27
    /**
28
     * @param Context $context
29
     * @param ForwardFactory $resultForwardFactory
30
     */
31
    public function __construct(
32
        Context $context,
33
        ForwardFactory $resultForwardFactory
34
    ) {
35
        $this->resultForwardFactory = $resultForwardFactory;
0 ignored issues
show
Documentation Bug introduced by
It seems like $resultForwardFactory of type object<Magento\Backend\M...\Result\ForwardFactory> is incompatible with the declared type object<Magento\Backend\Model\View\Result\Forward> of property $resultForwardFactory.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
36
        parent::__construct($context);
37
    }
38
39
    /**
40
     * @return Forward
41
     */
42
    public function execute()
43
    {
44
        /** @var Forward $resultForward */
45
        $resultForward = $this->resultForwardFactory->create();
46
        return $resultForward->forward('edit');
47
    }
48
}
49