Manage   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 69
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

Changes 2
Bugs 1 Features 0
Metric Value
c 2
b 1
f 0
dl 0
loc 69
wmc 3
lcom 1
cbo 0
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 13 1
A _isAllowed() 0 4 1
A execute() 0 4 1
1
<?php
2
3
namespace Jcowie\FeatureToggle\Controller\Adminhtml;
4
5
use Magento\Backend\App\Action;
6
use Magento\Backend\App\Action\Context;
7
use Magento\Backend\Model\View\Result\ForwardFactory;
8
use Magento\Framework\App\ResponseInterface;
9
use Magento\Framework\Exception\NoSuchEntityException;
10
use Magento\Framework\Registry;
11
use Magento\Framework\View\Result\PageFactory;
12
use Magento\Framework\View\Result\LayoutFactory;
13
14
class Manage extends Action
15
{
16
    /**
17
     * @var string
18
     */
19
    protected $aclAction = 'list';
20
21
    /**
22
     * @var PageFactory
23
     */
24
    protected $resultPageFactory;
25
26
    /**
27
     * @var ForwardFactory
28
     */
29
    protected $resultForwardFactory;
30
31
    /**
32
     * @var LayoutFactory
33
     */
34
    protected $resultLayoutFactory;
35
36
    /**
37
     * @var Registry
38
     */
39
    protected $coreRegistry;
40
41
    /**
42
     * @param Context                      $context
43
     * @param ForwardFactory               $resultForwardFactory
44
     * @param LayoutFactory                $resultLayoutFactory
45
     * @param PageFactory                  $resultPageFactory
46
     * @param Registry                     $coreRegistry
47
     */
48
    public function __construct(
49
        Context $context,
50
        ForwardFactory $resultForwardFactory,
51
        LayoutFactory $resultLayoutFactory,
52
        PageFactory $resultPageFactory,
53
        Registry $coreRegistry
54
    ) {
55
        parent::__construct($context);
56
        $this->resultPageFactory = $resultPageFactory;
57
        $this->resultForwardFactory = $resultForwardFactory;
58
        $this->resultLayoutFactory = $resultLayoutFactory;
59
        $this->coreRegistry = $coreRegistry;
60
    }
61
62
    /**
63
     * Customer access rights checking
64
     *
65
     * @return bool
66
     */
67
    protected function _isAllowed()
68
    {
69
        return $this->_authorization->isAllowed('Jcowie_Featuretoggle::' . $this->aclAction);
70
    }
71
72
    /**
73
     * Dispatch request
74
     *
75
     * @return \Magento\Framework\Controller\ResultInterface|ResponseInterface
76
     * @throws \Magento\Framework\Exception\NotFoundException
77
     */
78
    public function execute()
79
    {
80
        // TODO: Implement execute() method.
81
    }
82
}
83