Completed
Push — master ( da4b66...3ae217 )
by Tim
19s queued 15s
created

UnknownQuery   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 34
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 34
rs 10

3 Methods

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