D695::__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 D695 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 = 'D695';
12
    const LEVEL = 2;
13
    const PARENT = '';
14
15
    protected $parameters = [
16
        'COD_MOD' => [
17
            'type' => 'string',
18
            'regex' => '^.{2}$',
19
            'required' => true,
20
            'info' => 'Código do modelo do documento fiscal, conforme a Tabela 4.1.1.',
21
            'format' => ''
22
        ],
23
        'SER' => [
24
            'type' => 'string',
25
            'regex' => '^.{1,4}$',
26
            'required' => true,
27
            'info' => 'Série do documento fiscal ',
28
            'format' => ''
29
        ],
30
        'NRO_ORD_INI' => [
31
            'type' => 'numeric',
32
            'regex' => '^(\d{9})$',
33
            'required' => true,
34
            'info' => 'Número de ordem inicial ',
35
            'format' => ''
36
        ],
37
        'NRO_ORD_FIN' => [
38
            'type' => 'numeric',
39
            'regex' => '^(\d{9})$',
40
            'required' => true,
41
            'info' => 'Número de ordem final ',
42
            'format' => ''
43
        ],
44
        'DT_DOC_INI' => [
45
            'type' => 'numeric',
46
            'regex' => '^(\d{8})$',
47
            'required' => true,
48
            'info' => 'Data de emissão inicial dos documentos ',
49
            'format' => ''
50
        ],
51
        'DT_DOC_FIN' => [
52
            'type' => 'numeric',
53
            'regex' => '^(\d{8})$',
54
            'required' => true,
55
            'info' => 'Data de emissão final dos documentos ',
56
            'format' => ''
57
        ],
58
        'NOM_MEST' => [
59
            'type' => 'string',
60
            'regex' => '^.{1,33}$',
61
            'required' => true,
62
            'info' => 'Nome do arquivo Mestre de Documento Fiscal',
63
            'format' => ''
64
        ],
65
        'CHV_COD_DIG' => [
66
            'type' => 'string',
67
            'regex' => '^.{1,32}$',
68
            'required' => true,
69
            'info' => 'Chave de codificação digital do arquivo Mestre de Documento Fiscal',
70
            'format' => ''
71
        ],
72
    ];
73
74
    /**
75
     * Constructor
76
     * @param \stdClass $std
77
     */
78
    public function __construct(\stdClass $std)
79
    {
80
        parent::__construct(self::REG);
81
        $this->std = $this->standarize($std);
82
    }
83
}
84