Z0300   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
/**
10
 * Elemento 0300 do Bloco 0
11
 *
12
 *
13
 * NOTA: usada a letra Z no nome da Classe pois os nomes não podem ser exclusivamente
14
 * numeréricos e também para não confundir os com elementos do bloco B
15
 */
16
class Z0300 extends Element implements ElementInterface
17
{
18
    const REG = '0300';
19
    const LEVEL = 2;
20
    const PARENT = '';
21
    
22
    protected $parameters = [
23
        'COD_IND_BEM' => [
24
            'type'     => 'string',
25
            'regex'    => '^.{1,60}$',
26
            'required' => true,
27
            'info'     => 'Código individualizado do bem ou componente',
28
            'format'   => ''
29
        ],
30
        'IDENT_MERC' => [
31
            'type'     => 'integer',
32
            'regex'    => '^[0-1]{1}$',
33
            'required' => true,
34
            'info'     => 'Identificação do tipo de mercadoria',
35
            'format'   => ''
36
        ],
37
        'DESCR_ITEM' => [
38
            'type'     => 'string',
39
            'regex'    => '^.{1,255}$',
40
            'required' => true,
41
            'info'     => 'Descrição do bem ou componente',
42
            'format'   => ''
43
        ],
44
        'COD_PRNC' => [
45
            'type'     => 'string',
46
            'regex'    => '^.{0,60}$',
47
            'required' => false,
48
            'info'     => 'Código de cadastro do bem principal',
49
            'format'   => ''
50
        ],
51
        'COD_CTA' => [
52
            'type'     => 'string',
53
            'regex'    => '^.{1,60}$',
54
            'required' => true,
55
            'info'     => 'Código da conta analítica de contabilização',
56
            'format'   => ''
57
        ],
58
        'NR_PARC' => [
59
            'type'     => 'integer',
60
            'regex'    => '^[0-9]{1,3}$',
61
            'required' => false,
62
            'info'     => 'Número total de parcelas a serem apropriadas',
63
            'format'   => ''
64
        ],
65
    ];
66
    
67
    /**
68
     * Constructor
69
     * @param stdClass $std
70
     */
71
    public function __construct(stdClass $std)
72
    {
73
        parent::__construct(self::REG);
74
        $this->std = $this->standarize($std);
75
    }
76
}
77