CalculationTypeColumn::setInputId()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 3
rs 10
1
<?php
2
/**
3
 * Copyright © Getnet. All rights reserved.
4
 *
5
 * @author    Bruno Elisei <[email protected]>
6
 * See LICENSE for license details.
7
 */
8
9
declare(strict_types=1);
10
11
namespace Getnet\SplitExampleMagento\Block\Adminhtml\System\Form\Field\Column;
12
13
use Magento\Framework\View\Element\Html\Select;
14
15
/**
16
 * Class CalculationTypeColumn - Create Field to Calculation Type Column.
17
 */
18
class CalculationTypeColumn extends Select
19
{
20
    /**
21
     * @var SubSellerRepositoryInterface
0 ignored issues
show
Bug introduced by
The type Getnet\SplitExampleMagen...llerRepositoryInterface 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
     */
23
    protected $subSellerRepository;
24
25
    /**
26
     * @var SearchCriteriaBuilder
0 ignored issues
show
Bug introduced by
The type Getnet\SplitExampleMagen...n\SearchCriteriaBuilder 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
    protected $searchCriteria;
29
30
    /**
31
     * @var FilterBuilder
0 ignored issues
show
Bug introduced by
The type Getnet\SplitExampleMagen...ld\Column\FilterBuilder 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...
32
     */
33
    protected $filterBuilder;
34
35
    /**
36
     * Set "name" for <select> element.
37
     *
38
     * @param string $value
39
     *
40
     * @return void
41
     */
42
    public function setInputName($value)
43
    {
44
        return $this->setName($value);
0 ignored issues
show
Bug Best Practice introduced by
The expression return $this->setName($value) also could return the type Getnet\SplitExampleMagen...ypeColumn|array|boolean which is incompatible with the documented return type void.
Loading history...
Bug introduced by
The method setName() does not exist on Getnet\SplitExampleMagen...n\CalculationTypeColumn. Since you implemented __call, consider adding a @method annotation. ( Ignorable by Annotation )

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

44
        return $this->/** @scrutinizer ignore-call */ setName($value);
Loading history...
45
    }
46
47
    /**
48
     * Set "id" for <select> element.
49
     *
50
     * @param string $value
51
     *
52
     * @return void
53
     */
54
    public function setInputId($value)
55
    {
56
        return $this->setId($value);
0 ignored issues
show
Bug Best Practice introduced by
The expression return $this->setId($value) returns the type Getnet\SplitExampleMagen...n\CalculationTypeColumn which is incompatible with the documented return type void.
Loading history...
57
    }
58
59
    /**
60
     * Render block HTML.
61
     *
62
     * @return string
63
     */
64
    public function _toHtml(): string
65
    {
66
        if (!$this->getOptions()) {
67
            $this->setOptions($this->getSourceOptions());
68
        }
69
70
        return parent::_toHtml();
71
    }
72
73
    /**
74
     * Get Options.
75
     *
76
     * @return array
77
     */
78
    public function getSourceOptions(): array
79
    {
80
        $typeCalc = [
81
            [
82
                'value' => 'full',
83
                'label' => __('Receive the Full Amount'),
84
            ],
85
            [
86
                'value' => 'retain',
87
                'label' => __('Retain Full Value'),
88
            ],
89
        ];
90
91
        return $typeCalc;
92
    }
93
}
94