Z1800::__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\Contribuicoes;
4
5
use NFePHP\EFD\Common\Element;
6
use NFePHP\EFD\Common\ElementInterface;
7
use \stdClass;
8
9 View Code Duplication
class Z1800 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 = '1800';
12
    const LEVEL = 2;
13
    const PARENT = '1001';
14
15
    protected $parameters = [
16
        'INC_IMOB' => [
17
            'type' => 'string',
18
            'regex' => '^.{0,90}$',
19
            'required' => false,
20
            'info' => 'Empreendimento objeto de Incorporação Imobiliária, optante pelo RET. ',
21
            'format' => ''
22
        ],
23
        'REC_RECEB_RET' => [
24
            'type' => 'numeric',
25
            'regex' => '^\d+(\.\d*)?|\.\d+$',
26
            'required' => false,
27
            'info' => 'Receitas recebidas pela incorporadora na venda das unidades imobiliárias que compõem a ' .
28
                'incorporação. ',
29
            'format' => '15v2'
30
        ],
31
        'REC_FIN_RET' => [
32
            'type' => 'numeric',
33
            'regex' => '^\d+(\.\d*)?|\.\d+$',
34
            'required' => false,
35
            'info' => 'Receitas Financeiras e Variações Monetárias decorrentes das vendas submetidas ao RET. ',
36
            'format' => '15v2'
37
        ],
38
        'BC_RET' => [
39
            'type' => 'numeric',
40
            'regex' => '^\d+(\.\d*)?|\.\d+$',
41
            'required' => false,
42
            'info' => 'Base de Cálculo do Recolhimento Unificado ',
43
            'format' => '15v2'
44
        ],
45
        'ALIQ_RET' => [
46
            'type' => 'numeric',
47
            'regex' => '^\d+(\.\d*)?|\.\d+$',
48
            'required' => false,
49
            'info' => 'Alíquota do Recolhimento Unificado. ',
50
            'format' => '6v2'
51
        ],
52
        'VL_REC_UNI' => [
53
            'type' => 'numeric',
54
            'regex' => '^\d+(\.\d*)?|\.\d+$',
55
            'required' => false,
56
            'info' => 'Valor do Recolhimento Unificado. ',
57
            'format' => '15v2'
58
        ],
59
        'DT_REC_UNI' => [
60
            'type' => 'string',
61
            'regex' => '^(0[1-9]|[1-2][0-9]|31(?!(?:0[2469]|11))|30(?!02))(0[1-9]|1[0-2])([12]\d{3})$',
62
            'required' => false,
63
            'info' => 'Data do recolhimento unificado ',
64
            'format' => ''
65
        ],
66
        'COD_REC' => [
67
            'type' => 'string',
68
            'regex' => '^.{0,4}$',
69
            'required' => false,
70
            'info' => 'Código da Receita ',
71
            'format' => ''
72
        ],
73
74
    ];
75
76
    /**
77
     * Constructor
78
     * @param \stdClass $std
79
     */
80
    public function __construct(\stdClass $std)
81
    {
82
        parent::__construct(self::REG);
83
        $this->std = $this->standarize($std);
84
    }
85
}
86