Disable::_getElementHtml()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
cc 1
eloc 2
nc 1
nop 1
dl 0
loc 4
rs 10
c 1
b 0
f 1
1
<?php
2
3
/**
4
 * MagePrince
5
 *
6
 * NOTICE OF LICENSE
7
 *
8
 * This source file is subject to the mageprince.com license that is
9
 * available through the world-wide-web at this URL:
10
 * https://mageprince.com/end-user-license-agreement
11
 *
12
 * DISCLAIMER
13
 *
14
 * Do not edit or add to this file if you wish to upgrade this extension to newer
15
 * version in the future.
16
 *
17
 * @category    MagePrince
18
 * @package     Mageprince_BuyNow
19
 * @copyright   Copyright (c) MagePrince (https://mageprince.com/)
20
 * @license     https://mageprince.com/end-user-license-agreement
21
 */
22
23
namespace Mageprince\BuyNow\Block\Adminhtml\System\Config\Field;
24
25
use Magento\Config\Block\System\Config\Form\Field;
0 ignored issues
show
Bug introduced by
The type Magento\Config\Block\System\Config\Form\Field 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...
26
use Magento\Framework\Data\Form\Element\AbstractElement;
0 ignored issues
show
Bug introduced by
The type Magento\Framework\Data\F...Element\AbstractElement 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...
27
28
class Disable extends Field
29
{
30
    /**
31
     * Disable element
32
     *
33
     * @param AbstractElement $element
34
     * @return string
35
     */
36
    protected function _getElementHtml(AbstractElement $element)
37
    {
38
        $element->setDisabled('disabled');
39
        return $element->getElementHtml();
40
    }
41
}
42