Code Duplication    Length = 48-52 lines in 4 locations

src/Elements/I012.php 1 location

@@ 13-60 (lines=48) @@
10
 * Elemento I012 do Bloco I OBRIGATÓRIO [1:N]
11
 * REGISTRO I012: LIVROS AUXILIARES AO DIÁRIO OU LIVRO PRINCIPAL
12
 */
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)
55
    {
56
        parent::__construct(self::REG);
57
        $this->std = $this->standarize($std);
58
        $this->postValidation();
59
    }
60
}
61

src/Elements/J005.php 1 location

@@ 13-62 (lines=50) @@
10
 * Elemento J005 do Bloco J OBRIGATÓRIO [1:1]
11
 * REGISTRO J005: ABERTURA DO ARQUIVO DIGITAL E IDENTIFICAÇÃO DO EMPRESÁRIO OU DA SOCIEDADE EMPRESÁRIA
12
 */
13
class J005 extends Element implements ElementInterface
14
{
15
    const REG = 'J005';
16
    const LEVEL = 2;
17
    const PARENT = '';
18
19
    protected $parameters = [
20
        'dt_ini'     => [
21
            'type'     => 'string',
22
            'regex'    => '^(0[1-9]|[1-2][0-9]|31(?!(?:0[2469]|11))|30(?!02))(0[1-9]|1[0-2])([12]\d{3})$',
23
            'required' => true,
24
            'info'     => 'Data inicial das demonstrações contábeis.',
25
            'format'   => ''
26
        ],
27
        'dt_fin'     => [
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 final das demonstrações contábeis.',
32
            'format'   => ''
33
        ],
34
        'id_dem' => [
35
            'type'     => 'numeric',
36
            'regex'    => '^[1-2]{1}$',
37
            'required' => true,
38
            'info'     => 'Identificação das demonstrações:'
39
            .' 1 – demonstrações contábeis da pessoa jurídica a que se refere a escrituração;'
40
            .' 2 – demonstrações consolidadas ou de outras pessoas jurídicas.',
41
            'format'   => ''
42
        ],
43
        'cab_dem'     => [
44
            'type'     => 'string',
45
            'regex'    => '^[A-Za-z0-9]{65535}$',
46
            'required' => false,
47
            'info'     => 'Cabeçalho das demonstrações.',
48
            'format'   => ''
49
        ]
50
    ];
51
52
    /**
53
     * Constructor
54
     * @param \stdClass $std
55
     */
56
    public function __construct(\stdClass $std)
57
    {
58
        parent::__construct(self::REG);
59
        $this->std = $this->standarize($std);
60
        $this->postValidation();
61
    }
62
}
63

src/Elements/J215.php 1 location

@@ 13-64 (lines=52) @@
10
 * Elemento J215 do Bloco J OBRIGATÓRIO [1:1]
11
 * REGISTRO J215: ABERTURA DO ARQUIVO DIGITAL E IDENTIFICAÇÃO DO EMPRESÁRIO OU DA SOCIEDADE EMPRESÁRIA
12
 */
13
class J215 extends Element implements ElementInterface
14
{
15
    const REG = 'J215';
16
    const LEVEL = 4;
17
    const PARENT = '';
18
19
    protected $parameters = [
20
        'cod_hist_fat' => [
21
            'type'     => 'string',
22
            'regex'    => '^[A-Za-z0-9]$',
23
            'required' => true,
24
            'info'     => 'Código do histórico do fato contábil.',
25
            'format'   => ''
26
        ],
27
        'desc_fat' => [
28
            'type'     => 'string',
29
            'regex'    => '^[A-Za-z0-9]$',
30
            'required' => true,
31
            'info'     => 'Descrição do Fato Contábil',
32
            'format'   => ''
33
        ],
34
        'vl_fat_cont'    => [
35
            'type'     => 'numeric',
36
            'regex'    => '^\d+(\.\d*)?|\.\d+$',
37
            'required' => true,
38
            'info'     => 'Valor do fato contábil.',
39
            'format'   => '19v2'
40
        ],
41
        'ind_dc_fat' => [
42
            'type'     => 'string',
43
            'regex'    => '^(D|C|P|N)$',
44
            'required' => true,
45
            'info'     => 'Indicador de situação do saldo informado no campo anterior:'
46
            .' D – Devedor'
47
            .' C – Credor'
48
            .' P – Subtotal ou total positivo'
49
            .' N – Subtotal ou total negativo',
50
            'format'   => ''
51
        ]
52
    ];
53
54
    /**
55
     * Constructor
56
     * @param \stdClass $std
57
     */
58
    public function __construct(\stdClass $std)
59
    {
60
        parent::__construct(self::REG);
61
        $this->std = $this->standarize($std);
62
        $this->postValidation();
63
    }
64
}
65

src/Elements/K315.php 1 location

@@ 13-63 (lines=51) @@
10
 * Elemento K315 do Bloco K OBRIGATÓRIO [1:1]
11
 * REGISTRO K315: ABERTURA DO ARQUIVO DIGITAL E IDENTIFICAÇÃO DO EMPRESÁRIO OU DA SOCIEDADE EMPRESÁRIA
12
 */
13
class K315 extends Element implements ElementInterface
14
{
15
    const REG = 'K315';
16
    const LEVEL = 5;
17
    const PARENT = '';
18
19
    protected $parameters = [
20
        'emp_cod_contra'      => [
21
            'type'     => 'numeric',
22
            'regex'    => '^[0-9]{4}$',
23
            'required' => true,
24
            'info'     => 'Código da empresa da contrapartida',
25
            'format'   => ''
26
        ],
27
        'cod_contra'      => [
28
            'type'     => 'string',
29
            'regex'    => '^[A-Za-z0-9]$',
30
            'required' => true,
31
            'info'     => 'Código da conta consolidada da contrapartida',
32
            'format'   => ''
33
        ],
34
        'valor'        => [
35
            'type'     => 'numeric',
36
            'regex'    => '^\d+(\.\d*)?|\.\d+$',
37
            'required' => true,
38
            'info'     => 'Parcela da contrapartida do valor eliminado total',
39
            'format'   => '19v2'
40
        ],
41
        'ind_valor' => [
42
            'type'     => 'string',
43
            'regex'    => '^(D|C)$',
44
            'required' => true,
45
            'info'     => 'Indicador da situação do valor eliminado:'
46
                . ' D – Devedor;'
47
                . ' C – Credor.',
48
            'format'   => ''
49
        ]
50
51
    ];
52
53
    /**
54
     * Constructor
55
     * @param \stdClass $std
56
     */
57
    public function __construct(\stdClass $std)
58
    {
59
        parent::__construct(self::REG);
60
        $this->std = $this->standarize($std);
61
        $this->postValidation();
62
    }
63
}
64