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' => '^[A-Za-z0-9]$', |
25
|
|
|
'required' => true, |
26
|
|
|
'info' => 'Código da conta analítica debitada/creditada.', |
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' => 'string', |
38
|
|
|
'regex' => '^[0-9]{19}$', |
39
|
|
|
'required' => true, |
40
|
|
|
'info' => 'Valor da partida.', |
41
|
|
|
'format' => '' |
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' => '^[A-Za-z0-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
|
|
|
'vl_dc_mf' => [ |
79
|
|
|
'type' => 'string', |
80
|
|
|
'regex' => '^[0-9]{19}$', |
81
|
|
|
'required' => false, |
82
|
|
|
'info' => 'Valor da partida em moeda funcional, convertido para reais.', |
83
|
|
|
'format' => '' |
84
|
|
|
], |
85
|
|
|
'ind_dc_mf' => [ |
86
|
|
|
'type' => 'string', |
87
|
|
|
'regex' => '^(D|C)$', |
88
|
|
|
'required' => false, |
89
|
|
|
'info' => 'Indicador da natureza da partida em moeda funcional: D - Devedor; C - Credor.', |
90
|
|
|
'format' => '' |
91
|
|
|
] |
92
|
|
|
]; |
93
|
|
|
|
94
|
|
|
/** |
95
|
|
|
* Constructor |
96
|
|
|
* @param \stdClass $std |
97
|
|
|
*/ |
98
|
|
|
public function __construct(\stdClass $std) |
99
|
|
|
{ |
100
|
|
|
parent::__construct(self::REG); |
101
|
|
|
$this->std = $this->standarize($std); |
102
|
|
|
$this->postValidation(); |
|
|
|
|
103
|
|
|
} |
104
|
|
|
} |
105
|
|
|
|
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: