UnknownCondition   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 34
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 4
c 1
b 0
f 0
dl 0
loc 34
rs 10
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getRawCondition() 0 3 1
A __construct() 0 5 1
A toXML() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace SimpleSAML\SAML11\XML\saml;
6
7
use DOMElement;
8
use SimpleSAML\XML\Chunk;
9
use SimpleSAML\XMLSchema\Type\QNameValue;
10
11
/**
12
 * Class for unknown conditions.
13
 *
14
 * @package simplesamlphp/saml11
15
 */
16
final class UnknownCondition extends AbstractCondition
17
{
18
    /**
19
     * @param \SimpleSAML\XML\Chunk $chunk The whole Condition element as a chunk object.
20
     * @param \SimpleSAML\XMLSchema\Type\QNameValue $type The xsi:type of this condition.
21
     */
22
    public function __construct(
23
        protected Chunk $chunk,
24
        QNameValue $type,
25
    ) {
26
        parent::__construct($type);
27
    }
28
29
30
    /**
31
     * Get the raw version of this condition as a Chunk.
32
     *
33
     * @return \SimpleSAML\XML\Chunk
34
     */
35
    public function getRawCondition(): Chunk
36
    {
37
        return $this->chunk;
38
    }
39
40
41
    /**
42
     * Convert this unknown condition to XML.
43
     *
44
     * @param \DOMElement|null $parent The element we are converting to XML.
45
     * @return \DOMElement The XML element after adding the data corresponding to this unknown condition.
46
     */
47
    public function toXML(?DOMElement $parent = null): DOMElement
48
    {
49
        return $this->getRawCondition()->toXML($parent);
50
    }
51
}
52