M620   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 65
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 1
dl 0
loc 65
ccs 0
cts 5
cp 0
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
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
class M620 extends Element implements ElementInterface
10
{
11
    const REG = 'M620';
12
    const LEVEL = 4;
13
    const PARENT = 'M600';
14
15
    protected $parameters = [
16
        'IND_AJ' => [
17
            'type' => 'string',
18
            'regex' => '^(0|1)$',
19
            'required' => false,
20
            'info' => 'Indicador do tipo de ajuste ' .
21
                ' 0- Ajuste de redução ' .
22
                ' 1- Ajuste de acréscimo. ',
23
            'format' => ''
24
        ],
25
        'VL_AJ' => [
26
            'type' => 'numeric',
27
            'regex' => '^\d+(\.\d*)?|\.\d+$',
28
            'required' => false,
29
            'info' => 'Valor do ajuste ',
30
            'format' => '15v2'
31
        ],
32
        'COD_AJ' => [
33
            'type' => 'string',
34
            'regex' => '^.{2}$',
35
            'required' => false,
36
            'info' => 'Código do ajuste, conforme a Tabela indicada no item 4.3.8. ',
37
            'format' => ''
38
        ],
39
        'NUM_DOC' => [
40
            'type' => 'string',
41
            'regex' => '^(.*)$',
42
            'required' => false,
43
            'info' => 'Número do processo, documento ou ato concessório ao qual o ajuste está vinculado, se ' .
44
                'houver. ',
45
            'format' => ''
46
        ],
47
        'DESCR_AJ' => [
48
            'type' => 'string',
49
            'regex' => '^(.*)$',
50
            'required' => false,
51
            'info' => 'Descrição resumida do ajuste. ',
52
            'format' => ''
53
        ],
54
        'DT_REF' => [
55
            'type' => 'string',
56
            'regex' => '^(0[1-9]|[1-2][0-9]|31(?!(?:0[2469]|11))|30(?!02))(0[1-9]|1[0-2])([12]\d{3})$',
57
            'required' => false,
58
            'info' => 'Data de referência do ajuste (ddmmaaaa) ',
59
            'format' => ''
60
        ],
61
62
    ];
63
64
    /**
65
     * Constructor
66
     * @param \stdClass $std
67
     */
68
    public function __construct(\stdClass $std)
69
    {
70
        parent::__construct(self::REG);
71
        $this->std = $this->standarize($std);
72
    }
73
}
74