Z0005::__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
/**
10
 * Elemento 0005 do Bloco 0
11
 * REGISTRO 0005: DADOS COMPLEMENTARES DA ENTIDADE
12
 * Registro obrigatório utilizado para complementar as informações de
13
 * identificação do informante do arquivo.
14
 *
15
 * NOTA: usada a letra Z no nome da Classe pois os nomes não podem ser exclusivamente
16
 * numeréricos e também para não confundir os com elementos do bloco B
17
 */
18 View Code Duplication
class Z0005 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...
19
{
20
    const REG = '0005';
21
    const LEVEL = 2;
22
    const PARENT = '0001';
23
    
24
    protected $parameters = [
25
        'FANTASIA' => [
26
            'type'     => 'string',
27
            'regex'    => '^.{3,60}$',
28
            'required' => true,
29
            'info'     => 'Nome de fantasia associado ao nome empresarial.',
30
            'format'   => ''
31
        ],
32
        'CEP' => [
33
            'type'     => 'string',
34
            'regex'    => '^[0-9]{8}$',
35
            'required' => true,
36
            'info'     => 'Código de Endereçamento Postal.',
37
            'format'   => ''
38
        ],
39
        'END' => [
40
            'type'     => 'string',
41
            'regex'    => '^.{3,60}$',
42
            'required' => true,
43
            'info'     => 'Logradouro e endereço do imóvel.',
44
            'format'   => ''
45
        ],
46
        'NUM' => [
47
            'type'     => 'string',
48
            'regex'    => '^.{1,10}$',
49
            'required' => false,
50
            'info'     => 'Número do imóvel.',
51
            'format'   => ''
52
        ],
53
        'COMPL' => [
54
            'type'     => 'string',
55
            'regex'    => '^.{3,60}$',
56
            'required' => false,
57
            'info'     => 'Dados complementares do endereço.',
58
            'format'   => ''
59
        ],
60
        'BAIRRO' => [
61
            'type'     => 'string',
62
            'regex'    => '^.{3,60}$',
63
            'required' => true,
64
            'info'     => 'Bairro em que o imóvel está situado.',
65
            'format'   => ''
66
        ],
67
        'FONE' => [
68
            'type'     => 'string',
69
            'regex'    => '^[0-9]{8,11}$',
70
            'required' => false,
71
            'info'     => 'Número do telefone (DDD+FONE).',
72
            'format'   => ''
73
        ],
74
        'FAX' => [
75
            'type'     => 'string',
76
            'regex'    => '^[0-9]{8,11}$',
77
            'required' => false,
78
            'info'     => 'Número do fax.',
79
            'format'   => ''
80
        ],
81
        'EMAIL' => [
82
            'type'     => 'string',
83
            'regex'    => 'email',
84
            'required' => false,
85
            'info'     => 'Endereço do correio eletrônico.',
86
            'format'   => ''
87
        ]
88
    ];
89
    
90
    /**
91
     * Constructor
92
     * @param \stdClass $std
93
     */
94
    public function __construct(\stdClass $std)
95
    {
96
        parent::__construct(self::REG);
97
        $this->std = $this->standarize($std);
98
    }
99
}
100