1 | <?php |
||
13 | class J801 extends Element implements ElementInterface |
||
14 | { |
||
15 | const REG = 'J801'; |
||
16 | const LEVEL = 2; |
||
17 | const PARENT = ''; |
||
18 | |||
19 | protected $parameters = [ |
||
20 | 'tipo_doc' => [ |
||
21 | 'type' => 'string', |
||
22 | 'regex' => '^(001)$', |
||
23 | 'required' => true, |
||
24 | 'info' => 'Tipo de documento:' |
||
25 | .' 001: Termo de Verificação para Fins Substituição da ECD.', |
||
26 | 'format' => '' |
||
27 | ], |
||
28 | 'desc_rtf' => [ |
||
29 | 'type' => 'string', |
||
30 | 'regex' => '^[A-Za-z0-9]$', |
||
31 | 'required' => false, |
||
32 | 'info' => 'Descrição do arquivo .rtf.', |
||
33 | 'format' => '' |
||
34 | ], |
||
35 | 'cod_mot_subs' => [ |
||
36 | 'type' => 'string', |
||
37 | 'regex' => '^(001|002|003|004|005|099)$', |
||
38 | 'required' => true, |
||
39 | 'info' => 'Código do motivo da substituição:' |
||
40 | .' 001: Mudanças de saldos das contas que não podem ser realizadas por meio de lançamentos extemporâneos' |
||
41 | .' 002: Alteração de assinatura' |
||
42 | .' 003: Alteração de demonstrações contábeis' |
||
43 | .' 004: Alteração da forma de escrituração contábil' |
||
44 | .' 005: Alteração do número do livro' |
||
45 | .' 099: Outros', |
||
46 | 'format' => '' |
||
47 | ], |
||
48 | 'hash_rtf' => [ |
||
49 | 'type' => 'string', |
||
50 | 'regex' => '^.{1,40}$', |
||
51 | 'required' => false, |
||
52 | 'info' => 'Hash do arquivo .rtf incluído.', |
||
53 | 'format' => '' |
||
54 | ], |
||
55 | 'arq_rtf' => [ |
||
56 | 'type' => 'string', |
||
57 | 'regex' => '^[A-Za-z0-9]$', |
||
58 | 'required' => true, |
||
59 | 'info' => 'Sequência de bytes que representem um único arquivo no formato RTF (Rich Text Format).', |
||
60 | 'format' => '' |
||
61 | ], |
||
62 | 'ind_fim_rtf' => [ |
||
63 | 'type' => 'string', |
||
64 | 'regex' => '^(J800FIM)$', |
||
65 | 'required' => true, |
||
66 | 'info' => 'Indicador de fim do arquivo RTF. Texto fixo contendo J800FIM.', |
||
67 | 'format' => '' |
||
68 | ] |
||
69 | ]; |
||
70 | |||
71 | /** |
||
72 | * Constructor |
||
73 | * @param \stdClass $std |
||
74 | */ |
||
75 | public function __construct(\stdClass $std) |
||
81 | } |
||
82 |
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: