Create   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 9
c 1
b 0
f 0
dl 0
loc 30
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A execute() 0 9 1
1
<?php
2
3
namespace Tkotosz\CommandScheduler\Controller\Adminhtml\Schedule;
4
5
use Tkotosz\CommandScheduler\Controller\Adminhtml\Schedule;
6
use Magento\Backend\App\Action\Context;
0 ignored issues
show
Bug introduced by
The type Magento\Backend\App\Action\Context was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
7
use Magento\Framework\Controller\ResultFactory;
8
use Magento\Framework\Controller\ResultInterface;
9
use Magento\Framework\DataObject;
10
use Magento\Framework\Registry;
11
12
class Create extends Schedule
13
{
14
    /**
15
     * @var Registry
16
     */
17
    private $coreRegistry;
18
    
19
    /**
20
     * @param Registry $coreRegistry
21
     */
22
    public function __construct(Context $context, Registry $coreRegistry)
23
    {
24
        parent::__construct($context);
25
        $this->coreRegistry = $coreRegistry;
26
    }
27
    
28
    /**
29
     * Execute action based on request and return result
30
     *
31
     * @return ResultInterface
32
     */
33
    public function execute()
34
    {
35
        $this->coreRegistry->register('tkotosz_command_scheduler_data_container', new DataObject($this->getRequest()->getParams()));
0 ignored issues
show
Deprecated Code introduced by
The function Magento\Framework\Registry::register() has been deprecated: 102.0.0 ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-deprecated  annotation

35
        /** @scrutinizer ignore-deprecated */ $this->coreRegistry->register('tkotosz_command_scheduler_data_container', new DataObject($this->getRequest()->getParams()));

This function has been deprecated. The supplier of the function has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the function will be removed and what other function to use instead.

Loading history...
36
37
        $resultPage = $this->resultFactory->create(ResultFactory::TYPE_PAGE);
38
        $resultPage->setActiveMenu('Tkotosz_CommandScheduler::manage_schedules');
39
        $resultPage->getConfig()->getTitle()->prepend(__('Schedule Command'));
40
41
        return $resultPage;
42
    }
43
}
44