Z1105   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 61
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 1
dl 0
loc 61
ccs 0
cts 5
cp 0
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
1
<?php
2
3
namespace NFePHP\EFD\Elements\ICMSIPI;
4
5
use NFePHP\EFD\Common\Element;
6
use NFePHP\EFD\Common\ElementInterface;
7
use \stdClass;
8
9
class Z1105 extends Element implements ElementInterface
10
{
11
    const REG = '1105';
12
    const LEVEL = 3;
13
    const PARENT = '1100';
14
15
    protected $parameters = [
16
        'COD_MOD' => [
17
            'type'     => 'string',
18
            'regex'    => '^[0][1]|[5][5]$',
19
            'required' => true,
20
            'info'     => 'Código do modelo da NF, conforme tabela 4.1.1',
21
            'format'   => ''
22
        ],
23
        'SERIE' => [
24
            'type'     => 'string',
25
            'regex'    => '^.{1,3}$',
26
            'required' => false,
27
            'info'     => 'Série da Nota Fiscal',
28
            'format'   => ''
29
        ],
30
        'NUM_DOC' => [
31
            'type'     => 'integer',
32
            'regex'    => '^[1-9]\d{0,8}$',
33
            'required' => true,
34
            'info'     => 'Número de Nota Fiscal de Exportação emitida pelo Exportador',
35
            'format'   => ''
36
        ],
37
        'CHV_NFE' => [
38
            'type'     => 'numeric',
39
            'regex'    => '^([0-9]{44})?$',
40
            'required' => false,
41
            'info'     => 'Chave da Nota Fiscal Eletrônica',
42
            'format'   => ''
43
        ],
44
        'DT_DOC' => [
45
            'type'     => 'integer',
46
            'regex'    => '^(0[1-9]|[1-2][0-9]|31(?!(?:0[2469]|11))|30(?!02))(0[1-9]|1[0-2])([12]\d{3})$',
47
            'required' => true,
48
            'info'     => 'Data da emissão da NF de exportação',
49
            'format'   => ''
50
        ],
51
        'COD_ITEM' => [
52
            'type'     => 'string',
53
            'regex'    => '^.{1,60}$',
54
            'required' => true,
55
            'info'     => 'Código do item (campo 02 do Registro 0200)',
56
            'format'   => ''
57
        ]
58
    ];
59
60
    /**
61
     * Constructor
62
     * @param \stdClass $std
63
     */
64
    public function __construct(\stdClass $std)
65
    {
66
        parent::__construct(self::REG);
67
        $this->std = $this->standarize($std);
68
    }
69
}
70