|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
namespace NFePHP\ECD\Elements; |
|
4
|
|
|
|
|
5
|
|
|
use NFePHP\ECD\Common\Element; |
|
6
|
|
|
use NFePHP\ECD\Common\ElementInterface; |
|
7
|
|
|
use \stdClass; |
|
8
|
|
|
|
|
9
|
|
|
/** |
|
10
|
|
|
* Elemento I250 do Bloco I OBRIGATÓRIO [1:1] |
|
11
|
|
|
* REGISTRO I250: ABERTURA DO ARQUIVO DIGITAL E IDENTIFICAÇÃO DO EMPRESÁRIO OU DA SOCIEDADE EMPRESÁRIA |
|
12
|
|
|
* |
|
13
|
|
|
* Alterar campos: vl_dc / vl_dc_mf |
|
14
|
|
|
*/ |
|
15
|
|
|
class I250 extends Element implements ElementInterface |
|
16
|
|
|
{ |
|
17
|
|
|
const REG = 'I250'; |
|
18
|
|
|
const LEVEL = 4; |
|
19
|
|
|
const PARENT = ''; |
|
20
|
|
|
|
|
21
|
|
|
protected $parameters = [ |
|
22
|
|
|
'cod_cta' => [ |
|
23
|
|
|
'type' => 'string', |
|
24
|
|
|
'regex' => '^.*$', |
|
25
|
|
|
'required' => true, |
|
26
|
|
|
'info' => 'Código da conta analitica', |
|
27
|
|
|
'format' => '' |
|
28
|
|
|
], |
|
29
|
|
|
'cod_ccus' => [ |
|
30
|
|
|
'type' => 'string', |
|
31
|
|
|
'regex' => '^[A-Za-z0-9]$', |
|
32
|
|
|
'required' => false, |
|
33
|
|
|
'info' => 'Código do centro de custos.', |
|
34
|
|
|
'format' => '' |
|
35
|
|
|
], |
|
36
|
|
|
'vl_dc' => [ |
|
37
|
|
|
'type' => 'numeric', |
|
38
|
|
|
'regex' => '^\d+(\.\d*)?|\.\d+$', |
|
39
|
|
|
'required' => true, |
|
40
|
|
|
'info' => 'Valor da partida.', |
|
41
|
|
|
'format' => '19v2' |
|
42
|
|
|
], |
|
43
|
|
|
'ind_dc' => [ |
|
44
|
|
|
'type' => 'string', |
|
45
|
|
|
'regex' => '^(D|C)$', |
|
46
|
|
|
'required' => true, |
|
47
|
|
|
'info' => 'Indicador da situação do saldo final: D - Devedor; C - Credor.', |
|
48
|
|
|
'format' => '' |
|
49
|
|
|
], |
|
50
|
|
|
'num_arq' => [ |
|
51
|
|
|
'type' => 'string', |
|
52
|
|
|
'regex' => '^[0-9]$', |
|
53
|
|
|
'required' => false, |
|
54
|
|
|
'info' => 'Número, Código ou caminho de localização dos documentos arquivados.', |
|
55
|
|
|
'format' => '' |
|
56
|
|
|
], |
|
57
|
|
|
'cod_hist_pad' => [ |
|
58
|
|
|
'type' => 'string', |
|
59
|
|
|
'regex' => '^([0-9])*$', |
|
60
|
|
|
'required' => false, |
|
61
|
|
|
'info' => 'Código do histórico padronizado, conforme tabela I075.', |
|
62
|
|
|
'format' => '' |
|
63
|
|
|
], |
|
64
|
|
|
'hist' => [ |
|
65
|
|
|
'type' => 'string', |
|
66
|
|
|
'regex' => '^[A-Za-z0-9]{65535}$', |
|
67
|
|
|
'required' => false, |
|
68
|
|
|
'info' => 'Código do histórico padronizado, conforme tabela I075.', |
|
69
|
|
|
'format' => '' |
|
70
|
|
|
], |
|
71
|
|
|
'cod_part' => [ |
|
72
|
|
|
'type' => 'string', |
|
73
|
|
|
'regex' => '^[A-Za-z0-9]$', |
|
74
|
|
|
'required' => false, |
|
75
|
|
|
'info' => 'Código do histórico padronizado, conforme tabela I075.', |
|
76
|
|
|
'format' => '' |
|
77
|
|
|
] |
|
78
|
|
|
]; |
|
79
|
|
|
|
|
80
|
|
|
// , |
|
81
|
|
|
// 'vl_dc_mf' => [ |
|
82
|
|
|
// 'type' => 'string', |
|
83
|
|
|
// 'regex' => '^[0-9]{19}$', |
|
84
|
|
|
// 'required' => false, |
|
85
|
|
|
// 'info' => 'Valor da partida em moeda funcional, convertido para reais.', |
|
86
|
|
|
// 'format' => '' |
|
87
|
|
|
// ], |
|
88
|
|
|
// 'ind_dc_mf' => [ |
|
89
|
|
|
// 'type' => 'string', |
|
90
|
|
|
// 'regex' => '^(D|C)$', |
|
91
|
|
|
// 'required' => false, |
|
92
|
|
|
// 'info' => 'Indicador da natureza da partida em moeda funcional: D - Devedor; C - Credor.', |
|
93
|
|
|
// 'format' => '' |
|
94
|
|
|
// ] |
|
95
|
|
|
|
|
96
|
|
|
/** |
|
97
|
|
|
* Constructor |
|
98
|
|
|
* @param \stdClass $std |
|
99
|
|
|
*/ |
|
100
|
|
|
public function __construct(\stdClass $std) |
|
101
|
|
|
{ |
|
102
|
|
|
parent::__construct(self::REG); |
|
103
|
|
|
$this->std = $this->standarize($std); |
|
104
|
|
|
$this->postValidation(); |
|
|
|
|
|
|
105
|
|
|
} |
|
106
|
|
|
} |
|
107
|
|
|
|
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: