UnknownSubjectStatement   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 35
Duplicated Lines 0 %

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A getRawSubjectStatement() 0 3 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 SubjectStatements.
13
 *
14
 * @package simplesamlphp/saml11
15
 */
16
final class UnknownSubjectStatement extends AbstractSubjectStatement
17
{
18
    /**
19
     * @param \SimpleSAML\XML\Chunk $chunk The whole SubjectStatement element as a chunk object.
20
     * @param \SimpleSAML\XMLSchema\Type\QNameValue $type The xsi:type of this SubjectStatement
21
     */
22
    public function __construct(
23
        protected Chunk $chunk,
24
        QNameValue $type,
25
        protected Subject $subject,
26
    ) {
27
        parent::__construct($type, $subject);
28
    }
29
30
31
    /**
32
     * Get the raw version of this SubjectStatement as a Chunk.
33
     *
34
     * @return \SimpleSAML\XML\Chunk
35
     */
36
    public function getRawSubjectStatement(): Chunk
37
    {
38
        return $this->chunk;
39
    }
40
41
42
    /**
43
     * Convert this unknown SubjectStatement to XML.
44
     *
45
     * @param \DOMElement|null $parent The element we are converting to XML.
46
     * @return \DOMElement The XML element after adding the data corresponding to this unknown SubjectStatement.
47
     */
48
    public function toXML(?DOMElement $parent = null): DOMElement
49
    {
50
        return $this->getRawSubjectStatement()->toXML($parent);
51
    }
52
}
53