Z0600::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
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
/**
10
 * Elemento 0600 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 Z0600 extends Element implements ElementInterface
17
{
18
    const REG = '0600';
19
    const LEVEL = 2;
20
    const PARENT = '';
21
    
22
    protected $parameters = [
23
        'DT_ALT' => [
24
            'type'     => 'string',
25
            'regex'    => '^[0-9]{8}$',
26
            'required' => true,
27
            'info'     => 'Data da inclusão/alteração',
28
            'format'   => ''
29
        ],
30
        'COD_CCUS' => [
31
            'type'     => 'string',
32
            'regex'    => '^.{1,60}$',
33
            'required' => true,
34
            'info'     => 'Código do centro de custo',
35
            'format'   => ''
36
        ],
37
        'CCUS' => [
38
            'type'     => 'string',
39
            'regex'    => '^.{1,60}$',
40
            'required' => true,
41
            'info'     => 'Nome do centro de custo',
42
            'format'   => ''
43
        ],
44
    ];
45
    
46
    /**
47
     * Constructor
48
     * @param stdClass $std
49
     */
50
    public function __construct(stdClass $std)
51
    {
52
        parent::__construct(self::REG);
53
        $this->std = $this->standarize($std);
54
    }
55
}
56