K260::__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
class K260 extends Element implements ElementInterface
10
{
11
    const REG = 'K260';
12
    const LEVEL = 3;
13
    const PARENT = 'K100';
14
15
    protected $parameters = [
16
        'COD_OP_OS' => [
17
            'type'     => 'string',
18
            'regex'    => '^.{1,30}$',
19
            'required' => false,
20
            'info'     => 'Código de identificação da ordem de produção',
21
            'format'   => ''
22
        ],
23
        'COD_ITEM' => [
24
            'type'     => 'string',
25
            'regex'    => '^.{1,60}$',
26
            'required' => true,
27
            'info'     => 'Código do item (campo 02 do Registro 0200)',
28
            'format'   => ''
29
        ],
30
        'DT_SAIDA' => [
31
            'type'     => 'string',
32
            'regex'    => '^(0[1-9]|[1-2][0-9]|31(?!(?:0[2469]|11))|30(?!02))(0[1-9]|1[0-2])([12]\d{3})$',
33
            'required' => true,
34
            'info'     => 'Data de saída do estoque',
35
            'format'   => ''
36
        ],
37
        'QTD_SAIDA' => [
38
            'type'     => 'numeric',
39
            'regex'    => '^\d+(\.\d*)?|\.\d+$',
40
            'required' => true,
41
            'info'     => 'Quantidade de saída do estoque',
42
            'format'   => '15v3'
43
        ],
44
        'DT_RET' => [
45
            'type'     => 'string',
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' => false,
48
            'info'     => 'Data de retorno ao estoque (entrada)',
49
            'format'   => ''
50
        ],
51
        'QTD_RET' => [
52
            'type'     => 'numeric',
53
            'regex'    => '^\d+(\.\d*)?|\.\d+$',
54
            'required' => false,
55
            'info'     => 'Quantidade de retorno ao estoque (entrada)',
56
            'format'   => '15v3'
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