UnknownID   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 38
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 4
dl 0
loc 38
rs 10
c 0
b 0
f 0
wmc 3

3 Methods

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