E300   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 41
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 41
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
class E300 extends Element implements ElementInterface
10
{
11
    const REG = 'E300';
12
    const LEVEL = 2;
13
    const PARENT = 'E001';
14
15
    protected $parameters = [
16
        'UF' => [
17
            'type'     => 'string',
18
            'regex'    => '^.{1,2}$',
19
            'required' => true,
20
            'info'     => 'Sigla da unidade da federação a que se refere à apuração '
21
            .'do FCP e do ICMS Diferencial de Alíquota da UF de Origem/Destino',
22
            'format'   => ''
23
        ],
24
        'DT_INI' => [
25
            'type'     => 'integer',
26
            'regex'    => '^(0[1-9]|[1-2][0-9]|31(?!(?:0[2469]|11))|30(?!02))(0[1-9]|1[0-2])([12]\d{3})$',
27
            'required' => true,
28
            'info'     => 'Data inicial a que a apuração se refere',
29
            'format'   => ''
30
        ],
31
        'DT_FIN' => [
32
            'type'     => 'integer',
33
            'regex'    => '^(0[1-9]|[1-2][0-9]|31(?!(?:0[2469]|11))|30(?!02))(0[1-9]|1[0-2])([12]\d{3})$',
34
            'required' => true,
35
            'info'     => 'Data final a que a apuração se refere',
36
            'format'   => ''
37
        ]
38
    ];
39
40
    /**
41
     * Constructor
42
     * @param \stdClass $std
43
     */
44
    public function __construct(\stdClass $std)
45
    {
46
        parent::__construct(self::REG);
47
        $this->std = $this->standarize($std);
48
    }
49
}
50