Pdf   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 2
eloc 7
c 1
b 0
f 1
dl 0
loc 27
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
 * This file is part of riesenia/pohoda package.
4
 *
5
 * Licensed under the MIT License
6
 * (c) RIESENIA.com
7
 */
8
9
declare(strict_types=1);
10
11
namespace Riesenia\Pohoda\PrintRequest;
12
13
14
use Riesenia\Pohoda\AbstractAgenda;
15
use Riesenia\Pohoda\Common\OptionsResolver;
16
17
18
class Pdf extends AbstractAgenda
19
{
20
    /** @var string[] */
21
    protected array $elements = ['fileName'];
22
23
    /**
24
     * {@inheritdoc}
25
     */
26 2
    public function getXML(): \SimpleXMLElement
27
    {
28 2
        $xml = $this->createXML()->addChild('prn:pdf', '', $this->namespace('prn'));
29
30 2
        $this->addElements($xml, $this->elements, 'prn');
31
32 2
        return $xml;
33
    }
34
35
    /**
36
     * {@inheritdoc}
37
     */
38 1
    protected function configureOptions(OptionsResolver $resolver): void
39
    {
40
        // available options
41 1
        $resolver->setDefined($this->elements);
42
43
        // validate / format options
44 1
        $resolver->setRequired('fileName');
45
    }
46
}
47