StatementNumber::getXML()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 3
c 1
b 0
f 0
dl 0
loc 7
ccs 4
cts 4
cp 1
rs 10
cc 1
nc 1
nop 0
crap 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\Bank;
13
14
use Riesenia\Pohoda\AbstractAgenda;
15
use Riesenia\Pohoda\Common\OptionsResolver;
16
17
class StatementNumber extends AbstractAgenda
18
{
19
    /** @var string[] */
20
    protected array $elements = ['statementNumber', 'numberMovement'];
21
22
    /**
23
     * {@inheritdoc}
24
     */
25 4
    public function getXML(): \SimpleXMLElement
26
    {
27 4
        $xml = $this->createXML()->addChild('bnk:statementNumber', '', $this->namespace('bnk'));
28
29 4
        $this->addElements($xml, $this->elements, 'bnk');
30
31 4
        return $xml;
32
    }
33
34
    /**
35
     * {@inheritdoc}
36
     */
37 1
    protected function configureOptions(OptionsResolver $resolver): void
38
    {
39
        // available options
40 1
        $resolver->setDefined($this->elements);
41
42
        // validate / format options
43 1
        $resolver->setNormalizer('statementNumber', $this->normalizerFactory->getClosure('string10'));
44 1
        $resolver->setNormalizer('numberMovement', $this->normalizerFactory->getClosure('string6'));
45
    }
46
}
47