Passed
Pull Request — master (#63)
by
unknown
04:39
created

InputOptionList::setSysLanguageUid()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 1
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
namespace EWW\Dpf\Domain\Model;
3
4
/*
5
 * This file is part of the TYPO3 CMS project.
6
 *
7
 * It is free software; you can redistribute it and/or modify it under
8
 * the terms of the GNU General Public License, either version 2
9
 * of the License, or any later version.
10
 *
11
 * For the full copyright and license information, please read the
12
 * LICENSE.txt file that was distributed with this source code.
13
 *
14
 * The TYPO3 project - inspiring people to share!
15
 */
16
17
/**
18
 * InputOptionList
19
 */
20
class InputOptionList extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity
0 ignored issues
show
Bug introduced by
The type TYPO3\CMS\Extbase\DomainObject\AbstractEntity 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...
21
{
22
23
    /**
24
     * name
25
     *
26
     * @var string
27
     */
28
    protected $name = '';
29
30
    /**
31
     * displayName
32
     *
33
     * @var string
34
     */
35
    protected $displayName = '';
36
37
    /**
38
     * valueList
39
     *
40
     * @var string
41
     */
42
    protected $valueList = '';
43
44
    /**
45
     * valueLabelList
46
     *
47
     * @var string
48
     */
49
    protected $valueLabelList = '';
50
51
    /**
52
     * defaultValue
53
     *
54
     * @var string
55
     */
56
    protected $defaultValue = '';
57
58
    /**
59
     * __construct
60
     */
61
    public function __construct()
62
    {
63
64
    }
65
66
    /**
67
     * Returns the name
68
     *
69
     * @return string $name
70
     */
71
    public function getName()
72
    {
73
        return $this->name;
74
    }
75
76
    /**
77
     * Sets the name
78
     *
79
     * @param string $name
80
     * @return void
81
     */
82
    public function setName($name)
83
    {
84
        $this->name = $name;
85
    }
86
87
    /**
88
     * Returns the displayName
89
     *
90
     * @return string $displayName
91
     */
92
    public function getDisplayName()
93
    {
94
        return $this->displayName;
95
    }
96
97
    /**
98
     * Returns the valueList
99
     *
100
     * @return string $valueList
101
     */
102
    public function getValueList()
103
    {
104
        return $this->valueList;
105
    }
106
107
    /**
108
     * Sets the valueList
109
     *
110
     * @param string $valueList
111
     * @return void
112
     */
113
    public function setValueList($valueList)
114
    {
115
        $this->valueList = $valueList;
116
    }
117
118
    /**
119
     * Returns the valueLabelList
120
     *
121
     * @return string $valueLabelList
122
     */
123
    public function getValueLabelList()
124
    {
125
        return $this->valueLabelList;
126
    }
127
128
    /**
129
     * Sets the valueLabelList
130
     *
131
     * @param string $valueLabelList
132
     * @return void
133
     */
134
    public function setValueLabelList($valueLabelList)
135
    {
136
        $this->valueLabelList = $valueLabelList;
137
    }
138
139
    /**
140
     * Sets the displayName
141
     *
142
     * @param string $displayName
143
     * @return void
144
     */
145
    public function setDisplayName($displayName)
146
    {
147
        $this->displayName = $displayName;
148
    }
149
150
    /**
151
     * Returns the inputOptions
152
     *
153
     * @return array $inputOptions
154
     * @throws \Exception
155
     */
156
    public function getInputOptions()
157
    {
158
159
        $values = explode("|", $this->getValueList());
160
        $labels = explode("|", $this->getValueLabelList());
161
162
        if (sizeof($values) != sizeof($labels)) {
0 ignored issues
show
Bug introduced by
The call to sizeof() has too few arguments starting with mode. ( Ignorable by Annotation )

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

162
        if (/** @scrutinizer ignore-call */ sizeof($values) != sizeof($labels)) {

This check compares calls to functions or methods with their respective definitions. If the call has less arguments than are defined, it raises an issue.

If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress. Please note the @ignore annotation hint above.

Loading history...
163
            throw new \Exception('Invalid input option list configuration.');
164
        }
165
166
        return array_combine($values, $labels);
167
    }
168
169
    public function setL10nParent($l10nParent)
170
    {
171
        $this->l10nParent = $l10nParent;
0 ignored issues
show
Bug Best Practice introduced by
The property l10nParent does not exist. Although not strictly required by PHP, it is generally a best practice to declare properties explicitly.
Loading history...
172
    }
173
174
    public function setSysLanguageUid($sysLanguageUid)
175
    {
176
        $this->_languageUid = $sysLanguageUid;
0 ignored issues
show
Bug Best Practice introduced by
The property _languageUid does not exist. Although not strictly required by PHP, it is generally a best practice to declare properties explicitly.
Loading history...
177
    }
178
179
    /**
180
     * Returns the defaultValue
181
     *
182
     * @return string $defaultValue
183
     */
184
    public function getDefaultValue()
185
    {
186
        return $this->defaultValue;
187
    }
188
189
    /**
190
     * Sets the defaultValue
191
     *
192
     * @param string $defaultValue
193
     * @return void
194
     */
195
    public function setDefaultValue($defaultValue)
196
    {
197
        $this->defaultValue = $defaultValue;
198
    }
199
200
}
201