Code Duplication    Length = 62-65 lines in 4 locations

src/Elements/I200.php 1 location

@@ 13-77 (lines=65) @@
10
 * Elemento I200 do Bloco I OBRIGATÓRIO [1:1]
11
 * REGISTRO I200: ABERTURA DO ARQUIVO DIGITAL E IDENTIFICAÇÃO DO EMPRESÁRIO OU DA SOCIEDADE EMPRESÁRIA
12
 */
13
class I200 extends Element implements ElementInterface
14
{
15
    const REG = 'I200';
16
    const LEVEL = 3;
17
    const PARENT = '';
18
19
    protected $parameters = [
20
        'num_lcto'      => [
21
            'type'     => 'string',
22
            'regex'    => '^[0-9]$',
23
            'required' => true,
24
            'info'     => 'Número ou Código de identificação único do lançamento contábil.',
25
            'format'   => ''
26
        ],
27
        'dt_lcto'     => [
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 do lançamento.',
32
            'format'   => ''
33
        ],
34
        'vl_lcto'     => [
35
            'type'     => 'string',
36
            'regex'    => '^[0-9]{19}$',
37
            'required' => true,
38
            'info'     => 'Data final das informações contidas no arquivo.',
39
            'format'   => ''
40
        ],
41
        'ind_lcto' => [
42
            'type'     => 'string',
43
            'regex'    => '^(N|E)$',
44
            'required' => true,
45
            'info'     => 'Indicador do tipo de lançamento:
46
            N - Lançamento normal (todos os lançamentos, exceto os de encerramento das contas de resultado);
47
            E - Lançamento de encerramento de contas de resultado.
48
            X – Lançamento extemporâneo.',
49
            'format'   => ''
50
        ],
51
        'dt_lcto_ext'     => [
52
            'type'     => 'string',
53
            'regex'    => '^(0[1-9]|[1-2][0-9]|31(?!(?:0[2469]|11))|30(?!02))(0[1-9]|1[0-2])([12]\d{3})$',
54
            'required' => false,
55
            'info'     => 'Data de ocorrência dos fatos objeto do lançamento extemporâneo.',
56
            'format'   => ''
57
        ],
58
        'vl_lcto_mf'     => [
59
            'type'     => 'string',
60
            'regex'    => '^[0-9]{19}$',
61
            'required' => false,
62
            'info'     => 'Valor do lançamento em moeda funcional, convertido para reais.',
63
            'format'   => ''
64
        ]
65
    ];
66
67
    /**
68
     * Constructor
69
     * @param \stdClass $std
70
     */
71
    public function __construct(\stdClass $std)
72
    {
73
        parent::__construct(self::REG);
74
        $this->std = $this->standarize($std);
75
        $this->postValidation();
76
    }
77
}
78

src/Elements/I310.php 1 location

@@ 15-76 (lines=62) @@
12
 * 
13
 * Alterar campos: val_debd / val_credd / val_deb_mf / val_cred_mf
14
 */
15
class I310 extends Element implements ElementInterface
16
{
17
    const REG = 'I310';
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
        'val_debd'     => [
37
            'type'     => 'string',
38
            'regex'    => '^[0-9]{19}$',
39
            'required' => true,
40
            'info'     => 'Total dos débitos do dia.',
41
            'format'   => ''
42
        ],
43
        'val_credd'     => [
44
            'type'     => 'string',
45
            'regex'    => '^[0-9]{19}$',
46
            'required' => true,
47
            'info'     => 'Total dos créditos do dia.',
48
            'format'   => ''
49
        ],
50
        'val_deb_mf'     => [
51
            'type'     => 'string',
52
            'regex'    => '^[0-9]{19}$',
53
            'required' => false,
54
            'info'     => 'Total dos débitos do dia em moeda funcional, convertido para reais.',
55
            'format'   => ''
56
        ],
57
        'val_cred_mf'     => [
58
            'type'     => 'string',
59
            'regex'    => '^[0-9]{19}$',
60
            'required' => false,
61
            'info'     => 'Total dos créditos do dia em moeda funcional, convertido para reais.',
62
            'format'   => ''
63
        ]
64
    ];
65
66
    /**
67
     * Constructor
68
     * @param \stdClass $std
69
     */
70
    public function __construct(\stdClass $std)
71
    {
72
        parent::__construct(self::REG);
73
        $this->std = $this->standarize($std);
74
        $this->postValidation();
75
    }
76
}
77

src/Elements/I355.php 1 location

@@ 15-76 (lines=62) @@
12
 * 
13
 * Alterar campos: vl_cta e vl_cta_mf
14
 */
15
class I355 extends Element implements ElementInterface
16
{
17
    const REG = 'I355';
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 de resultado.',
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_cta'     => [
37
            'type'     => 'string',
38
            'regex'    => '^[0-9]{19}$',
39
            'required' => true,
40
            'info'     => 'Valor do saldo final antes do lançamento de encerramento.',
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
        'vl_cta_mf'     => [
51
            'type'     => 'string',
52
            'regex'    => '^[0-9]{19}$',
53
            'required' => false,
54
            'info'     => 'Valor do saldo final antes do lançamento de encerramento em moeda funcional, convertido para reais.',
55
            'format'   => ''
56
        ],
57
        'ind_dc_mf' => [
58
            'type'     => 'string',
59
            'regex'    => '^(D|C)$',
60
            'required' => false,
61
            'info'     => 'Indicador da situação do saldo final em moeda funcional: D - Devedor; C - Credor.',
62
            'format'   => ''
63
        ]
64
    ];
65
66
    /**
67
     * Constructor
68
     * @param \stdClass $std
69
     */
70
    public function __construct(\stdClass $std)
71
    {
72
        parent::__construct(self::REG);
73
        $this->std = $this->standarize($std);
74
        $this->postValidation();
75
    }
76
}
77

src/Elements/I510.php 1 location

@@ 13-74 (lines=62) @@
10
 * Elemento I510 do Bloco I OBRIGATÓRIO [1:1]
11
 * REGISTRO I510: ABERTURA DO ARQUIVO DIGITAL E IDENTIFICAÇÃO DO EMPRESÁRIO OU DA SOCIEDADE EMPRESÁRIA 
12
 */
13
class I510 extends Element implements ElementInterface
14
{
15
    const REG = 'I510';
16
    const LEVEL = 3;
17
    const PARENT = '';
18
19
    protected $parameters = [
20
        'nm_campo' => [
21
            'type'     => 'string',
22
            'regex'    => '^[A-Za-z0-9]{16}$',
23
            'required' => true,
24
            'info'     => 'Nome do campo, sem espaços em branco ou caractere especial.',
25
            'format'   => ''
26
        ],
27
        'desc_campo' => [
28
            'type'     => 'string',
29
            'regex'    => '^[A-Za-z0-9]{50}$',
30
            'required' => true,
31
            'info'     => 'Descrição do campo (utilizada na visualização do Livro Auxiliar).',
32
            'format'   => ''
33
        ],
34
        'tipo_campo' => [
35
            'type'     => 'string',
36
            'regex'    => '^(N|C)$',
37
            'required' => true,
38
            'info'     => 'Tipo do campo: N – Numérico; C – Caractere.',
39
            'format'   => ''
40
        ],
41
        'tam_campo' => [
42
            'type'     => 'numeric',
43
            'regex'    => '^[0-9]{3}$',
44
            'required' => true,
45
            'info'     => 'Tamanho da campo.',
46
            'format'   => ''
47
        ],
48
        'dec_campo' => [
49
            'type'     => 'numeric',
50
            'regex'    => '^[0-9]{2}$',
51
            'required' => false,
52
            'info'     => 'Quantidade de casas decimais para campos tipo “N”.',
53
            'format'   => ''
54
        ],
55
        'col_campo' => [
56
            'type'     => 'numeric',
57
            'regex'    => '^[0-9]{3}$',
58
            'required' => true,
59
            'info'     => 'Largura da coluna no relatório (em quantidade de caracteres).',
60
            'format'   => ''
61
        ]
62
    ];
63
64
    /**
65
     * Constructor
66
     * @param \stdClass $std
67
     */
68
    public function __construct(\stdClass $std)
69
    {
70
        parent::__construct(self::REG);
71
        $this->std = $this->standarize($std);
72
        $this->postValidation();
73
    }
74
}
75