Index::execute()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 8

Duplication

Lines 8
Ratio 100 %

Importance

Changes 0
Metric Value
dl 8
loc 8
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
namespace LizardMedia\CronScheduler\Controller\Adminhtml\Configuration;
3
4
use Magento\Backend\Model\View\Result\Page;
5
use Magento\Framework\App\ResponseInterface;
6
use Magento\Framework\Controller\ResultInterface;
7
use Magento\Framework\View\Result\PageFactory;
8
use Magento\Backend\App\Action\Context;
9
use Magento\Backend\App\Action;
10
11
/**
12
 * Class Index
13
 * @package LizardMedia\CronScheduler\Controller\Adminhtml\Configuration
14
 */
15 View Code Duplication
class Index extends Action
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
16
{
17
    /**
18
     * @const string
19
     */
20
    const ADMIN_RESOURCE = "LizardMedia_CronScheduler::cron_configuration";
21
    
22
    /**
23
     * @const string
24
     */
25
    const TITLE = 'Cron Jobs Configuration';
26
27
    /**
28
     * @var PageFactory
29
     */
30
    protected $resultPageFactory;
31
32
    /**
33
     * @param PageFactory $resultPageFactory
34
     * @param Context $context
35
     */
36
    public function __construct(
37
        PageFactory $resultPageFactory,
38
        Context $context
39
    ) {
40
        parent::__construct($context);
41
        $this->resultPageFactory = $resultPageFactory;
42
    }
43
44
    /**
45
     * @return Page|ResponseInterface|ResultInterface
46
     */
47
    public function execute()
48
    {
49
        /** @var Page $resultPage */
50
        $resultPage = $this->resultPageFactory->create();
51
        $resultPage->setActiveMenu(self::ADMIN_RESOURCE);
52
        $resultPage->getConfig()->getTitle()->prepend(__(self::TITLE));
53
        return $resultPage;
54
    }
55
}
56