Z1110::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5

Duplication

Lines 5
Ratio 100 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 5
loc 5
ccs 0
cts 5
cp 0
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
crap 2
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 View Code Duplication
class Z1110 extends Element implements ElementInterface
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
10
{
11
    const REG = '1110';
12
    const LEVEL = 4;
13
    const PARENT = '1105';
14
15
    protected $parameters = [
16
        'COD_PART' => [
17
            'type'     => 'string',
18
            'regex'    => '^.{1,60}$',
19
            'required' => true,
20
            'info'     => 'Código do participante-Fornecedor da Mercadoria destinada '
21
            .'à exportação (campo 02 do Registro 0150)',
22
            'format'   => ''
23
        ],
24
        'COD_MOD' => [
25
            'type'     => 'string',
26
            'regex'    => '^[0][1|4]|[1][B]|[5][5]$',
27
            'required' => true,
28
            'info'     => 'Código do documento fiscal, conforme a Tabela 4.1.1',
29
            'format'   => ''
30
        ],
31
        'SER' => [
32
            'type'     => 'string',
33
            'regex'    => '^.{1,4}$',
34
            'required' => false,
35
            'info'     => 'Série do documento fiscal recebido com fins específicos de exportação.',
36
            'format'   => ''
37
        ],
38
        'NUM_DOC' => [
39
            'type'     => 'integer',
40
            'regex'    => '^[1-9]\d{0,8}$',
41
            'required' => true,
42
            'info'     => 'Número do documento fiscal recebido com fins específicos de exportação.',
43
            'format'   => ''
44
        ],
45
        'DT_DOC' => [
46
            'type'     => 'integer',
47
            'regex'    => '^(0[1-9]|[1-2][0-9]|31(?!(?:0[2469]|11))|30(?!02))(0[1-9]|1[0-2])([12]\d{3})$',
48
            'required' => true,
49
            'info'     => 'Data da emissão do documento fiscal recebido com fins específicos de exportação',
50
            'format'   => ''
51
        ],
52
        'CHV_NFE' => [
53
            'type'     => 'numeric',
54
            'regex'    => '^([0-9]{44})?$',
55
            'required' => false,
56
            'info'     => 'Chave da Nota Fiscal Eletrônica',
57
            'format'   => ''
58
        ],
59
        'NR_MEMO' => [
60
            'type'     => 'integer',
61
            'regex'    => '^\d+$',
62
            'required' => false,
63
            'info'     => 'Número do Memorando de Exportação',
64
            'format'   => ''
65
        ],
66
        'QTD' => [
67
            'type'     => 'integer',
68
            'regex'    => '^[1-9](\d?)+$',
69
            'required' => true,
70
            'info'     => 'Quantidade do item efetivamente exportado.',
71
            'format'   => ''
72
        ],
73
        'UNID' => [
74
            'type'     => 'string',
75
            'regex'    => '^.{1,6}$',
76
            'required' => true,
77
            'info'     => 'Unidade do item (Campo 02 do registro 0190)',
78
            'format'   => ''
79
        ]
80
    ];
81
82
    /**
83
     * Constructor
84
     * @param \stdClass $std
85
     */
86
    public function __construct(\stdClass $std)
87
    {
88
        parent::__construct(self::REG);
89
        $this->std = $this->standarize($std);
90
    }
91
}
92