| 1 | <?php |
||
| 13 | class I012 extends Element implements ElementInterface |
||
| 14 | { |
||
| 15 | const REG = 'I012'; |
||
| 16 | const LEVEL = 3; |
||
| 17 | const PARENT = ''; |
||
| 18 | |||
| 19 | protected $parameters = [ |
||
| 20 | 'num_ord' => [ |
||
| 21 | 'type' => 'numeric', |
||
| 22 | 'regex' => '^([1-9][0-9]*)$', |
||
| 23 | 'required' => true, |
||
| 24 | 'info' => 'Número de ordem do instrumento associado.', |
||
| 25 | 'format' => '' |
||
| 26 | ], |
||
| 27 | 'nat_liv' => [ |
||
| 28 | 'type' => 'string', |
||
| 29 | 'regex' => '^[A-Za-z0-9]{80}$', |
||
| 30 | 'required' => true, |
||
| 31 | 'info' => 'Natureza do livro associado; finalidade a que se destina o instrumento.', |
||
| 32 | 'format' => '' |
||
| 33 | ], |
||
| 34 | 'tipo' => [ |
||
| 35 | 'type' => 'numeric', |
||
| 36 | 'regex' => '^[0-1]{1}$', |
||
| 37 | 'required' => true, |
||
| 38 | 'info' => '0 - Bloco com dados informados;1- Bloco sem dados informados.', |
||
| 39 | 'format' => '' |
||
| 40 | ], |
||
| 41 | 'cod_hash_aux' => [ |
||
| 42 | 'type' => 'string', |
||
| 43 | 'regex' => '^.{1,40}$', |
||
| 44 | 'required' => false, |
||
| 45 | 'info' => 'Código Hash do arquivo correspondente ao livro auxiliar utilizado na assinatura digital.', |
||
| 46 | 'format' => '' |
||
| 47 | ] |
||
| 48 | ]; |
||
| 49 | |||
| 50 | /** |
||
| 51 | * Constructor |
||
| 52 | * @param \stdClass $std |
||
| 53 | */ |
||
| 54 | public function __construct(\stdClass $std) |
||
| 60 | } |
||
| 61 |
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: