RestrictionData   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 2
eloc 8
c 2
b 0
f 0
dl 0
loc 30
ccs 7
cts 7
cp 1
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getXML() 0 7 1
A configureOptions() 0 7 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\ListRequest;
13
14
use Riesenia\Pohoda\AbstractAgenda;
15
use Riesenia\Pohoda\Common\OptionsResolver;
16
17
class RestrictionData extends AbstractAgenda
18
{
19
    /** @var string[] */
20
    protected array $refElements = [];
21
22
    /** @var string[] */
23
    protected array $elements = ['liquidations'];
24
25
    /**
26
     * {@inheritdoc}
27
     */
28 2
    public function getXML(): \SimpleXMLElement
29
    {
30 2
        $xml = $this->createXML()->addChild('lst:restrictionData', '', $this->namespace('lst'));
31
32 2
        $this->addElements($xml, $this->elements, 'lst');
33
34 2
        return $xml;
35
    }
36
37
    /**
38
     * {@inheritdoc}
39
     */
40 1
    protected function configureOptions(OptionsResolver $resolver): void
41
    {
42
        // available options
43 1
        $resolver->setDefined($this->elements);
44
45
        // validate / format options
46 1
        $resolver->setNormalizer('liquidations', $this->normalizerFactory->getClosure('bool'));
47
    }
48
}
49