Code Duplication    Length = 34-36 lines in 5 locations

src/Elements/I051.php 1 location

@@ 13-48 (lines=36) @@
10
 * Elemento I051 do Bloco I OBRIGATÓRIO [0:N]
11
 * REGISTRO I051: PLANO DE CONTAS REFERENCIAL
12
 */
13
class I051 extends Element implements ElementInterface
14
{
15
    const REG = 'I051';
16
    const LEVEL = 4;
17
    const PARENT = '';
18
19
    protected $parameters = [
20
        'cod_ccus'     => [
21
            'type'     => 'string',
22
            'regex'    => '^[A-Za-z0-9]$',
23
            'required' => false,
24
            'info'     => 'Codigo do Centro de Custo.',
25
            'format'   => ''
26
        ],
27
        'cod_cta_ref'  => [
28
            'type'     => 'string',
29
            'regex'    => '^[A-Za-z0-9]$',
30
            'required' => true,
31
            'info'     => 'Codigo da conta de acordo com Plano de Contas referencial, '
32
                . 'conforme tabela publicada pelos orgaos indicados no campo '
33
                . 'COD_PLAN_REF do registro 0000.',
34
            'format'   => ''
35
        ]
36
    ];
37
38
    /**
39
     * Constructor
40
     * @param \stdClass $std
41
     */
42
    public function __construct(\stdClass $std)
43
    {
44
        parent::__construct(self::REG);
45
        $this->std = $this->standarize($std);
46
        $this->postValidation();
47
    }
48
}
49

src/Elements/I052.php 1 location

@@ 13-47 (lines=35) @@
10
 * Elemento I052 do Bloco I OBRIGATÓRIO [0:N]
11
 * REGISTRO I052: INDICAÇÃO DOS CÓDIGOS DE AGLUTINAÇÃO
12
 */
13
class I052 extends Element implements ElementInterface
14
{
15
    const REG = 'I052';
16
    const LEVEL = 4;
17
    const PARENT = '';
18
19
    protected $parameters = [
20
        'cod_ccus'     => [
21
            'type'     => 'string',
22
            'regex'    => '^[A-Za-z0-9]$',
23
            'required' => false,
24
            'info'     => 'Codigo do Centro de Custo.',
25
            'format'   => ''
26
        ],
27
        'cod_agl'  => [
28
            'type'     => 'string',
29
            'regex'    => '^[A-Za-z0-9]$',
30
            'required' => true,
31
            'info'     => 'Codigo de aglutinacao utilizado nas demonstracoes '
32
                . 'contabeis do bloco J (somente para as contas analiticas).',
33
            'format'   => ''
34
        ]
35
    ];
36
37
    /**
38
     * Constructor
39
     * @param \stdClass $std
40
     */
41
    public function __construct(\stdClass $std)
42
    {
43
        parent::__construct(self::REG);
44
        $this->std = $this->standarize($std);
45
        $this->postValidation();
46
    }
47
}
48

src/Elements/Z0007.php 1 location

@@ 13-46 (lines=34) @@
10
 * Elemento 0007 do Bloco 0 OPCIONAL [0:N]
11
 * REGISTRO 0007: OUTRAS INSCRIÇÕES CADASTRAIS DA PESSOA JURÍDICA
12
 */
13
class Z0007 extends Element implements ElementInterface
14
{
15
    const REG = '0007';
16
    const LEVEL = 2;
17
    const PARENT = '0001';
18
19
    protected $parameters = [
20
        'cod_ent_ref'  => [
21
            'type'     => 'string',
22
            'regex'    => '^[A-Za-z0-9]{2}$',
23
            'required' => false,
24
            'info'     => 'Código da instituição responsável pela administração docadastro.',
25
            'format'   => ''
26
        ],
27
        'cod_inscr'  => [
28
            'type'     => 'string',
29
            'regex'    => '^.{1,25}$',
30
            'required' => false,
31
            'info'     => 'Código cadastral da pessoa jurídica na instituição identificada no campo COD_ENT_REF.',
32
            'format'   => ''
33
        ],
34
    ];
35
36
    /**
37
     * Constructor
38
     * @param \stdClass $std
39
     */
40
    public function __construct(\stdClass $std)
41
    {
42
        parent::__construct(self::REG);
43
        $this->std = $this->standarize($std);
44
        $this->postValidation();
45
    }
46
}
47

src/Elements/K030.php 1 location

@@ 13-46 (lines=34) @@
10
 * Elemento K030 do Bloco K OBRIGATÓRIO [1:1]
11
 * REGISTRO K030: ABERTURA DO ARQUIVO DIGITAL E IDENTIFICAÇÃO DO EMPRESÁRIO OU DA SOCIEDADE EMPRESÁRIA
12
 */
13
class K030 extends Element implements ElementInterface
14
{
15
    const REG = 'K030';
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 do período consolidado.',
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 do período consolidado.',
32
            'format'   => ''
33
        ]
34
    ];
35
36
    /**
37
     * Constructor
38
     * @param \stdClass $std
39
     */
40
    public function __construct(\stdClass $std)
41
    {
42
        parent::__construct(self::REG);
43
        $this->std = $this->standarize($std);
44
        $this->postValidation();
45
    }
46
}
47

src/Elements/K210.php 1 location

@@ 13-46 (lines=34) @@
10
 * Elemento K210 do Bloco K OBRIGATÓRIO [1:1]
11
 * REGISTRO K210: ABERTURA DO ARQUIVO DIGITAL E IDENTIFICAÇÃO DO EMPRESÁRIO OU DA SOCIEDADE EMPRESÁRIA
12
 */
13
class K210 extends Element implements ElementInterface
14
{
15
    const REG = 'K210';
16
    const LEVEL = 4;
17
    const PARENT = '';
18
19
    protected $parameters = [
20
        'cod_emp'      => [
21
            'type'     => 'numeric',
22
            'regex'    => '^[0-9]{4}$',
23
            'required' => true,
24
            'info'     => 'Código de identificação da empresa participante',
25
            'format'   => ''
26
        ],
27
        'cod_cta_emp'      => [
28
            'type'     => 'string',
29
            'regex'    => '^[A-Za-z0-9]$',
30
            'required' => true,
31
            'info'     => 'Código da conta da empresa participante',
32
            'format'   => ''
33
        ]
34
    ];
35
36
    /**
37
     * Constructor
38
     * @param \stdClass $std
39
     */
40
    public function __construct(\stdClass $std)
41
    {
42
        parent::__construct(self::REG);
43
        $this->std = $this->standarize($std);
44
        $this->postValidation();
45
    }
46
}
47