UnknownSubjectQuery   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 35
Duplicated Lines 0 %

Importance

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

3 Methods

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