Passed
Push — master ( 221c35...fdb910 )
by Petr
02:59
created

ItemUserCode   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
eloc 11
c 1
b 0
f 0
dl 0
loc 30
ccs 12
cts 12
cp 1
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getDefaultDto() 0 3 1
A getXML() 0 11 2
1
<?php
2
3
declare(strict_types=1);
4
5
namespace kalanis\Pohoda\UserList;
6
7
use kalanis\Pohoda\AbstractAgenda;
8
use kalanis\Pohoda\Common;
9
10
/**
11
 * @property ItemUserCodeDto $data
12
 */
13
class ItemUserCode extends AbstractAgenda
14
{
15
    /**
16
     * {@inheritdoc}
17
     */
18 2
    public function getXML(): \SimpleXMLElement
19
    {
20 2
        $xml = $this->createXML()->addChild('lst:itemUserCode', '', $this->namespace('lst'));
21 2
        $xml->addAttribute('code', strval($this->data->code));
22 2
        $xml->addAttribute('name', strval($this->data->name));
23
24 2
        if (isset($this->data->constant)) {
25 1
            $xml->addAttribute('constant', strval($this->data->constant));
26
        }
27
28 2
        return $xml;
29
    }
30
31
    /**
32
     * {@inheritdoc}
33
     */
34 2
    protected function getDefaultDto(): Common\Dtos\AbstractDto
35
    {
36 2
        return new ItemUserCodeDto();
37
    }
38
}
39