D360::__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 D360 extends Element implements ElementInterface
10
{
11
    const REG = 'D360';
12
    const LEVEL = 4;
13
    const PARENT = '';
14
15
    protected $parameters = [
16
        'VL_PIS' => [
17
            'type'     => 'numeric',
18
            'regex'    => '^\d+(\.\d*)?|\.\d+$',
19
            'required' => true,
20
            'info'     => 'Valor total do PIS',
21
            'format'   => '15v2'
22
        ],
23
        'VL_COFINS' => [
24
            'type'     => 'numeric',
25
            'regex'    => '^\d+(\.\d*)?|\.\d+$',
26
            'required' => true,
27
            'info'     => 'Valor total da COFINS',
28
            'format'   => '15v2'
29
        ]
30
    ];
31
32
    /**
33
     * Constructor
34
     * @param \stdClass $std
35
     */
36
    public function __construct(\stdClass $std)
37
    {
38
        parent::__construct(self::REG);
39
        $this->std = $this->standarize($std);
40
    }
41
}
42