Passed
Push — master ( ca7167...276d5c )
by Fabian
06:10
created

Configuration::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 10
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 4
nc 1
nop 3
1
<?php
2
3
namespace Firegento\DevDashboard\Block\Adminhtml\Dashboard;
4
5
class Configuration extends \Magento\Config\Block\System\Config\Edit
0 ignored issues
show
Bug introduced by
The type Magento\Config\Block\System\Config\Edit 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...
6
{
7
8
    /**
9
     * @var mixed
10
     */
11
    public $originalParams;
12
13
    /**
14
     * Configuration constructor.
15
     *
16
     * @param \Magento\Backend\Block\Template\Context $context
17
     * @param \Magento\Config\Model\Config\Structure  $configStructure
18
     * @param array                                   $data
19
     */
20
    public function __construct(
21
        \Magento\Backend\Block\Template\Context $context,
0 ignored issues
show
Bug introduced by
The type Magento\Backend\Block\Template\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...
22
        \Magento\Config\Model\Config\Structure $configStructure,
0 ignored issues
show
Bug introduced by
The type Magento\Config\Model\Config\Structure 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...
23
        array $data = []
24
    ) {
25
        parent::__construct($context, $configStructure, $data);
26
27
        $this->_prepareRequestParams();
28
        $this->setTitle(__('Developer configurations'));
0 ignored issues
show
Bug introduced by
The function __ was not found. Maybe you did not declare it correctly or list all dependencies? ( Ignorable by Annotation )

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

28
        $this->setTitle(/** @scrutinizer ignore-call */ __('Developer configurations'));
Loading history...
29
        $this->_resetRequestParams();
30
    }
31
32
    /**
33
     * @return $this
34
     */
35
    public function _prepareLayout()
36
    {
37
        $this->_prepareRequestParams();
38
        parent::_prepareLayout();
39
40
        return $this;
41
    }
42
43
    /**
44
     *
45
     */
46
    public function _prepareRequestParams()
47
    {
48
        $this->originalParams = $this->getRequest()->getParam('section');
49
        $this->getRequest()->setParam('section', 'dev');
50
    }
51
52
    /**
53
     *
54
     */
55
    public function _resetRequestParams()
56
    {
57
        $this->getRequest()->setParam('section', $this->originalParams);
58
    }
59
60
    /**
61
     * @return string
62
     */
63
    public function getSaveUrl()
64
    {
65
        return $this->getUrl('adminhtml/system_config/save', ['section' => 'dev']);
66
    }
67
}
68