1 | <?php |
||
16 | class RangeField extends FormField |
||
17 | { |
||
18 | |||
19 | /** |
||
20 | * @var array|int |
||
21 | */ |
||
22 | protected $start = [0]; |
||
23 | |||
24 | |||
25 | /** |
||
26 | * @var array |
||
27 | */ |
||
28 | protected $min = 0; |
||
29 | |||
30 | /** |
||
31 | * @var int |
||
32 | */ |
||
33 | protected $max = 100; |
||
34 | |||
35 | /** |
||
36 | * @var array |
||
37 | */ |
||
38 | protected $range = []; |
||
39 | |||
40 | /** |
||
41 | * @var bool |
||
42 | */ |
||
43 | protected $snap = false; |
||
44 | |||
45 | /** |
||
46 | * @var array |
||
47 | */ |
||
48 | protected $data = []; |
||
49 | |||
50 | /** |
||
51 | * @var int |
||
52 | */ |
||
53 | protected $density = 4; |
||
54 | |||
55 | /** |
||
56 | * @var bool |
||
57 | */ |
||
58 | protected $showPips = true; |
||
59 | |||
60 | /** |
||
61 | * @var int|bool |
||
62 | */ |
||
63 | protected $step; |
||
64 | |||
65 | /** |
||
66 | * RangeField constructor. |
||
67 | * @param string $name The internal field name, passed to forms. |
||
68 | * @param null|string $title The human-readable field label. |
||
69 | * @param int|array $start Starting point(s) on the line |
||
70 | * @param mixed $value The value of the field. |
||
71 | * @param int|array $min Lowest value of the range |
||
72 | * @param int $max Highest value of the range |
||
73 | * @param array $range Associative array with keys which determine the percentage point on the range |
||
74 | * And values being the labels on the field |
||
75 | */ |
||
76 | public function __construct($name, $title = null, $start = 0, $min = 0, $max = 100, $range = [], $value = null) |
||
91 | |||
92 | /** |
||
93 | * @param array $properties |
||
94 | * @return \SilverStripe\ORM\FieldType\DBHTMLText |
||
95 | */ |
||
96 | public function Field($properties = array()) |
||
137 | |||
138 | /** |
||
139 | * @return array|int |
||
140 | */ |
||
141 | public function getStart() |
||
145 | |||
146 | /** |
||
147 | * @param array|int $start |
||
148 | */ |
||
149 | public function setStart($start) |
||
153 | |||
154 | /** |
||
155 | * @return array |
||
156 | */ |
||
157 | public function getMin() |
||
161 | |||
162 | /** |
||
163 | * @param int|array $min |
||
164 | */ |
||
165 | public function setMin($min) |
||
169 | |||
170 | /** |
||
171 | * @return int |
||
172 | */ |
||
173 | public function getMax() |
||
177 | |||
178 | /** |
||
179 | * @param int $max |
||
180 | */ |
||
181 | public function setMax($max) |
||
185 | |||
186 | /** |
||
187 | * @return array |
||
188 | */ |
||
189 | public function getRange() |
||
193 | |||
194 | /** |
||
195 | * @param array $range |
||
196 | */ |
||
197 | public function setRange($range) |
||
201 | |||
202 | /** |
||
203 | * @return bool |
||
204 | */ |
||
205 | public function isSnap() |
||
209 | |||
210 | /** |
||
211 | * @param bool $snap |
||
212 | */ |
||
213 | public function setSnap($snap) |
||
217 | |||
218 | /** |
||
219 | * @return array |
||
220 | */ |
||
221 | public function getData() |
||
225 | |||
226 | /** |
||
227 | * @param array $data |
||
228 | */ |
||
229 | public function setData($data) |
||
233 | |||
234 | |||
235 | /** |
||
236 | * @return int |
||
237 | */ |
||
238 | public function getDensity() |
||
242 | |||
243 | /** |
||
244 | * @param int $density |
||
245 | */ |
||
246 | public function setDensity($density) |
||
250 | |||
251 | /** |
||
252 | * @return bool |
||
253 | */ |
||
254 | public function isShowPips() |
||
258 | |||
259 | /** |
||
260 | * @param bool $showPips |
||
261 | */ |
||
262 | public function setShowPips($showPips) |
||
266 | |||
267 | /** |
||
268 | * @return int |
||
269 | */ |
||
270 | public function getStep() |
||
274 | |||
275 | /** |
||
276 | * @param int $step |
||
277 | */ |
||
278 | public function setStep($step) |
||
282 | |||
283 | } |
||
284 |
Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.
Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..