| 1 | <?php | ||
| 13 | class K110 extends Element implements ElementInterface | ||
| 14 | { | ||
| 15 | const REG = 'K110'; | ||
| 16 | const LEVEL = 4; | ||
| 17 | const PARENT = ''; | ||
| 18 | |||
| 19 | protected $parameters = [ | ||
| 20 | 'evento' => [ | ||
| 21 | 'type' => 'numeric', | ||
| 22 | 'regex' => '^(1|2|3|4|5|6|7|8)$', | ||
| 23 | 'required' => true, | ||
| 24 | 'info' => 'Evento societário ocorrido no período:' | ||
| 25 | .' 1 – Aquisição' | ||
| 26 | .' 2 – Alienação' | ||
| 27 | .' 3 – Fusão' | ||
| 28 | .' 4 – Cisão Parcial' | ||
| 29 | .' 5 – Cisão Total' | ||
| 30 | .' 6 – Incorporação' | ||
| 31 | .' 7 – Extinção' | ||
| 32 | .' 8 – Constituição', | ||
| 33 | 'format' => '' | ||
| 34 | ], | ||
| 35 | 'dt_evento' => [ | ||
| 36 | 'type' => 'string', | ||
| 37 |             'regex'    => '^(0[1-9]|[1-2][0-9]|31(?!(?:0[2469]|11))|30(?!02))(0[1-9]|1[0-2])([12]\d{3})$', | ||
| 38 | 'required' => true, | ||
| 39 | 'info' => 'Data do evento societário.', | ||
| 40 | 'format' => '' | ||
| 41 | ] | ||
| 42 | ]; | ||
| 43 | |||
| 44 | /** | ||
| 45 | * Constructor | ||
| 46 | * @param \stdClass $std | ||
| 47 | */ | ||
| 48 | public function __construct(\stdClass $std) | ||
| 54 | } | ||
| 55 | 
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: