IntDoc::getDocumentElements()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
eloc 1
c 0
b 0
f 0
dl 0
loc 3
ccs 2
cts 2
cp 1
rs 10
cc 1
nc 1
nop 0
crap 1
1
<?php
2
3
/**
4
 * This file is part of riesenia/pohoda package.
5
 *
6
 * Licensed under the MIT License
7
 * (c) RIESENIA.com
8
 */
9
10
declare(strict_types=1);
11
12
namespace Riesenia\Pohoda;
13
14
/**
15
 * @property array{
16
 *     taxDocument?: Type\TaxDocument,
17
 * } $data
18
 */
19
class IntDoc extends AbstractDocument
20
{
21 6
    public function getImportRoot(): string
22
    {
23 6
        return 'lst:intDoc';
24
    }
25
26
    /**
27
     * Add tax document.
28
     *
29
     * @param array<string,mixed> $data
30
     *
31
     * @return $this
32
     */
33 1
    public function addTaxDocument(array $data): self
34
    {
35 1
        $taxDocument = new Type\TaxDocument($this->dependenciesFactory);
36 1
        $taxDocument
37 1
            ->setDirectionalVariable($this->useOneDirectionalVariables)
38 1
            ->setResolveOptions($this->resolveOptions)
39 1
            ->setData($data);
40 1
        $this->data['taxDocument'] = $taxDocument;
41
42 1
        return $this;
43
    }
44
45
    /**
46
     * {@inheritdoc}
47
     */
48 5
    protected function getDocumentElements(): array
49
    {
50 5
        return \array_merge(['taxDocument'], parent::getDocumentElements());
51
    }
52
53
    /**
54
     * {@inheritdoc}
55
     */
56 6
    protected function getDocumentNamespace(): string
57
    {
58 6
        return 'int';
59
    }
60
61
    /**
62
     * {@inheritdoc}
63
     */
64 6
    protected function getDocumentName(): string
65
    {
66 6
        return 'intDoc';
67
    }
68
}
69