D161::__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 D161 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 = 'D161';
12
    const LEVEL = 4;
13
    const PARENT = '';
14
15
    protected $parameters = [
16
        'IND_CARGA' => [
17
            'type'     => 'numeric',
18
            'regex'    => '',
19
            'required' => true,
20
            'info'     => 'Indicador do tipo de transporte da carga coletada: 0 - Rodoviário'
21
            . '1 - Ferroviário'
22
            . '2 - Rodo-Ferroviário'
23
            . '3 - Aquaviário'
24
            . '4 - Dutoviário'
25
            . '5 - Aéreo'
26
            . '9 - Outros',
27
            'format'   => ''
28
        ],
29
        'CNPJ_CPF_COL' => [
30
            'type'     => 'string',
31
            'regex'    => '^[0-9]{14}$',
32
            'required' => true,
33
            'info'     => 'Número do CNPJ ou CPF do local da coleta',
34
            'format'   => ''
35
        ],
36
        'IE_COL' => [
37
            'type'     => 'string',
38
            'regex'    => '^[0-9]{14}$',
39
            'required' => true,
40
            'info'     => 'Inscrição Estadual do contribuinte do local de coleta',
41
            'format'   => ''
42
        ],
43
        'COD_MUN_COL' => [
44
            'type'     => 'numeric',
45
            'regex'    => '',
46
            'required' => true,
47
            'info'     => 'Código do Município do local de coleta, conforme tabela IBGE',
48
            'format'   => ''
49
        ],
50
        'CNPJ_CPF_ENTG' => [
51
            'type'     => 'string',
52
            'regex'    => '^[0-9]{14}$',
53
            'required' => true,
54
            'info'     => 'Número do CNPJ ou CPF do local da entrega',
55
            'format'   => ''
56
        ],
57
        'IE_ENTG' => [
58
            'type'     => 'string',
59
            'regex'    => '^[0-9]{14}$',
60
            'required' => true,
61
            'info'     => 'Inscrição Estadual do contribuinte do local de entrega',
62
            'format'   => ''
63
        ],
64
        'COD_MUN_ENTG' => [
65
            'type'     => 'numeric',
66
            'regex' => '^[0-9]{7}$',
67
            'required' => true,
68
            'info'     => 'Código do Município do local de entrega, conforme tabela IBGE',
69
            'format'   => ''
70
        ]
71
    ];
72
73
    /**
74
     * Constructor
75
     * @param \stdClass $std
76
     */
77
    public function __construct(\stdClass $std)
78
    {
79
        parent::__construct(self::REG);
80
        $this->std = $this->standarize($std);
81
    }
82
}
83