Summary   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 4
eloc 9
dl 0
loc 25
c 0
b 0
f 0
ccs 10
cts 10
cp 1
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getXML() 0 15 3
A getDefaultDto() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace kalanis\Pohoda\Order;
6
7
use kalanis\Pohoda\Common\Dtos;
8
use kalanis\Pohoda\Document\AbstractSummary;
9
use kalanis\PohodaException;
10
11
class Summary extends AbstractSummary
12
{
13
    /**
14
     * {@inheritdoc}
15
     */
16 5
    public function getXML(): \SimpleXMLElement
17
    {
18 5
        if (is_null($this->namespace)) {
19 1
            throw new PohodaException('Namespace not set.');
20
        }
21
22 4
        if (is_null($this->nodePrefix)) {
23 1
            throw new PohodaException('Node name prefix not set.');
24
        }
25
26 3
        $xml = $this->createXML()->addChild($this->namespace . ':' . $this->nodePrefix . 'Summary', '', $this->namespace($this->namespace));
27
28 3
        $this->addElements($xml, $this->getDataElements(), $this->namespace);
29
30 3
        return $xml;
31
    }
32
33 5
    protected function getDefaultDto(): Dtos\AbstractDto
34
    {
35 5
        return new SummaryDto();
36
    }
37
}
38