1 | <?php |
||
13 | class I010 extends Element implements ElementInterface |
||
14 | { |
||
15 | const REG = 'I010'; |
||
16 | const LEVEL = 2; |
||
17 | const PARENT = ''; |
||
18 | |||
19 | protected $parameters = [ |
||
20 | 'ind_esc' => [ |
||
21 | 'type' => 'string', |
||
22 | 'regex' => '^[G|R|A|B|Z]{1}$', |
||
23 | 'required' => true, |
||
24 | 'info' => 'Indicador da forma de escrituração contábi.', |
||
25 | 'format' => '' |
||
26 | ], |
||
27 | 'cod_ver_lc' => [ |
||
28 | 'type' => 'string', |
||
29 | 'regex' => '^(8.00)$', |
||
30 | 'required' => true, |
||
31 | 'info' => 'Código da versao do layout contabil.', |
||
32 | 'format' => '' |
||
33 | ] |
||
34 | ]; |
||
35 | |||
36 | /** |
||
37 | * Constructor |
||
38 | * @param \stdClass $std |
||
39 | */ |
||
40 | public function __construct(\stdClass $std) |
||
46 | } |
||
47 |
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: