Total Complexity | 7 |
Total Lines | 36 |
Duplicated Lines | 0 % |
Changes | 2 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
5 | class SelectField extends Field |
||
6 | { |
||
7 | public $options; |
||
8 | |||
9 | function __construct($name, $options, $default = null, $hint = null) |
||
18 | } |
||
19 | |||
20 | function init($request) |
||
|
|||
21 | { |
||
22 | $this->value = $this->default; |
||
23 | $v = str_replace('+', ' ', $request->get($this->name)); |
||
24 | if (in_array($v, $this->options)) |
||
25 | $this->value = $v; |
||
26 | } |
||
27 | |||
28 | function renderBody($name, $id) |
||
41 | } |
||
42 | } |
||
43 |
Adding explicit visibility (
private
,protected
, orpublic
) is generally recommend to communicate to other developers how, and from where this method is intended to be used.