D010::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
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
8
class D010 extends Element implements ElementInterface
9
{
10
    const REG = 'D010';
11
    const LEVEL = 2;
12
    const PARENT = 'D001';
13
14
    protected $parameters = [
15
        'CNPJ' => [
16
            'type' => 'string',
17
            'regex' => '^[0-9]{14}$',
18
            'required' => false,
19
            'info' => 'Número de inscrição do estabelecimento no CNPJ. ',
20
            'format' => ''
21
        ],
22
23
    ];
24
25
    /**
26
     * Constructor
27
     * @param \stdClass $std
28
     */
29
    public function __construct(\stdClass $std)
30
    {
31
        parent::__construct(self::REG);
32
        $this->std = $this->standarize($std);
33
    }
34
}
35