Category   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 3
eloc 7
dl 0
loc 21
c 0
b 0
f 0
ccs 9
cts 9
cp 1
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getDefaultDto() 0 3 1
A getXML() 0 7 2
1
<?php
2
3
declare(strict_types=1);
4
5
namespace kalanis\Pohoda\Stock;
6
7
use kalanis\Pohoda\AbstractAgenda;
8
use kalanis\Pohoda\Common;
9
10
class Category extends AbstractAgenda
11
{
12
    /**
13
     * {@inheritdoc}
14
     */
15 1
    public function getXML(): \SimpleXMLElement
16
    {
17 1
        $category = $this->data->idCategory ?? null;
18 1
        return $this->createXML()->addChild(
19 1
            'stk:idCategory',
20 1
            is_null($category) ? null : strval($category),
21 1
            $this->namespace('stk'),
22 1
        );
23
    }
24
25
    /**
26
     * {@inheritdoc}
27
     */
28 1
    protected function getDefaultDto(): Common\Dtos\AbstractDto
29
    {
30 1
        return new CategoryDto();
31
    }
32
}
33