Completed
Push — master ( 4abc70...47f934 )
by Roberto
06:04 queued 10s
created

K290::__construct()   A

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 K290 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 = 'K290';
12
    const LEVEL = 3;
13
    const PARENT = 'K100';
14
15
    protected $parameters = [
16
        'DT_INI_OP' => [
17
            'type'     => 'string',
18
            'regex'    => '^(0[1-9]|[1-2][0-9]|31(?!(?:0[2469]|11))|30(?!02))(0[1-9]|1[0-2])([12]\d{3})$',
19
            'required' => false,
20
            'info'     => 'Data de início da ordem de produção',
21
            'format'   => ''
22
        ],
23
        'DT_FIN_OP' => [
24
            'type'     => 'string',
25
            'regex'    => '^(0[1-9]|[1-2][0-9]|31(?!(?:0[2469]|11))|30(?!02))(0[1-9]|1[0-2])([12]\d{3})$',
26
            'required' => false,
27
            'info'     => 'Data de conclusão da ordem de produção',
28
            'format'   => ''
29
        ],
30
        'COD_DOC_OP' => [
31
            'type'     => 'string',
32
            'regex'    => '^.{1,30}$',
33
            'required' => false,
34
            'info'     => 'Código de identificação da ordem de produção',
35
            'format'   => ''
36
        ]
37
    ];
38
    
39
    /**
40
     * Constructor
41
     * @param \stdClass $std
42
     */
43
    public function __construct(\stdClass $std)
44
    {
45
        parent::__construct(self::REG);
46
        $this->std = $this->standarize($std);
47
    }
48
}
49