Category::getDefaultDto()   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
dl 0
loc 3
c 0
b 0
f 0
ccs 2
cts 2
cp 1
rs 10
cc 1
nc 1
nop 0
crap 1
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