1 | <?php |
||
12 | class FieldSelect extends Abstract_\FormFieldDefault { |
||
13 | |||
14 | /** |
||
15 | * |
||
16 | * |
||
17 | * @var hemio\html\Select |
||
18 | */ |
||
19 | protected $controlElement; |
||
20 | |||
21 | /** |
||
22 | * |
||
23 | * @var boolean |
||
24 | */ |
||
25 | protected $filled = false; |
||
26 | |||
27 | public function __construct($name, $title) { |
||
30 | |||
31 | /** |
||
32 | * |
||
33 | * @return html\Select |
||
34 | */ |
||
35 | public function getControlElement() { |
||
38 | |||
39 | /** |
||
40 | * |
||
41 | * @return \hemio\form\Abstract_\TemplateFormField |
||
42 | */ |
||
43 | public function fill() { |
||
60 | |||
61 | /** |
||
62 | * |
||
63 | * @param mixed $value |
||
64 | * @param mixed $content |
||
65 | * @return html\Option |
||
66 | */ |
||
67 | public function addOption($value, $content = null) { |
||
76 | |||
77 | } |
||
78 |
PHP Analyzer performs a side-effects analysis of your code. A side-effect is basically anything that might be visible after the scope of the method is left.
Let’s take a look at an example:
If we look at the
getEmail()
method, we can see that it has no side-effect. Whether you call this method or not, no future calls to other methods are affected by this. As such code as the following is useless:On the hand, if we look at the
setEmail()
, this method _has_ side-effects. In the following case, we could not remove the method call: