C130::__construct()   A
last analyzed

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 C130 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 = 'C130';
12
    const LEVEL = 3;
13
    const PARENT = 'C100';
14
15
    protected $parameters = [
16
        'VL_SERV_NT' => [
17
            'type' => 'numeric',
18
            'regex' => '^\d+(\.\d*)?|\.\d+$',
19
            'required' => true,
20
            'info' => 'Valor dos serviços sob não-incidência ou nãotributados pelo ICMS',
21
            'format' => '15v2'
22
        ],
23
        'VL_BC_ISSQN' => [
24
            'type' => 'numeric',
25
            'regex' => '^\d+(\.\d*)?|\.\d+$',
26
            'required' => true,
27
            'info' => 'Valor da base de cálculo do ISSQN',
28
            'format' => '15v2'
29
        ],
30
        'VL_ISSQN' => [
31
            'type' => 'numeric',
32
            'regex' => '^\d+(\.\d*)?|\.\d+$',
33
            'required' => false,
34
            'info' => 'Valor do ISSQN',
35
            'format' => '15v2'
36
        ],
37
        'VL_BC_IRRF' => [
38
            'type' => 'numeric',
39
            'regex' => '^\d+(\.\d*)?|\.\d+$',
40
            'required' => false,
41
            'info' => 'Valor da base de cálculo do Imposto de Renda Retido na Fonte',
42
            'format' => '15v2'
43
        ],
44
        'VL_IRRF' => [
45
            'type' => 'numeric',
46
            'regex' => '^\d+(\.\d*)?|\.\d+$',
47
            'required' => false,
48
            'info' => 'Valor do Imposto de Renda - Retido na Fonte',
49
            'format' => '15v2'
50
        ],
51
        'VL_BC_PREV' => [
52
            'type' => 'numeric',
53
            'regex' => '^\d+(\.\d*)?|\.\d+$',
54
            'required' => false,
55
            'info' => 'Valor da base de cálculo de retenção da Previdência Social',
56
            'format' => '15v2'
57
        ],
58
        'VL_PREV' => [
59
            'type' => 'numeric',
60
            'regex' => '^\d+(\.\d*)?|\.\d+$',
61
            'required' => false,
62
            'info' => 'Valor destacado para retenção da Previdência Social',
63
            'format' => '15v2'
64
        ],
65
    ];
66
67
    /**
68
     * Constructor
69
     * @param \stdClass $std
70
     */
71
    public function __construct(\stdClass $std)
72
    {
73
        parent::__construct(self::REG);
74
        $this->std = $this->standarize($std);
75
    }
76
}
77