| 1 | <?php |
||
| 13 | class I150 extends Element implements ElementInterface |
||
| 14 | { |
||
| 15 | const REG = 'I150'; |
||
| 16 | const LEVEL = 3; |
||
| 17 | const PARENT = 'I010'; |
||
| 18 | |||
| 19 | protected $parameters = [ |
||
| 20 | 'dt_ini' => [ |
||
| 21 | 'type' => 'string', |
||
| 22 | 'regex' => '^(0[1-9]|[1-2][0-9]|31(?!(?:0[2469]|11))|30(?!02))(0[1-9]|1[0-2])([12]\d{3})$', |
||
| 23 | 'required' => true, |
||
| 24 | 'info' => 'Data de inicio do perido.', |
||
| 25 | 'format' => '' |
||
| 26 | ], |
||
| 27 | 'dt_fin' => [ |
||
| 28 | 'type' => 'string', |
||
| 29 | 'regex' => '^(0[1-9]|[1-2][0-9]|31(?!(?:0[2469]|11))|30(?!02))(0[1-9]|1[0-2])([12]\d{3})$', |
||
| 30 | 'required' => true, |
||
| 31 | 'info' => 'Data de fim do perido.', |
||
| 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: