Passed
Pull Request — master (#305)
by Jaime Pérez
03:35 queued 01:06
created

UnknownStatement::getRawStatement()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 3
rs 10
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 statements.
12
 *
13
 * @package simplesamlphp/saml2
14
 */
15
final class UnknownStatement extends AbstractStatement
16
{
17
    /** @var \SimpleSAML\XML\Chunk */
18
    protected Chunk $chunk;
19
20
21
    /**
22
     * @param \SimpleSAML\XML\Chunk $chunk The whole Statement element as a chunk object.
23
     * @param string $type The xsi:type of this statement
24
     */
25
    public function __construct(
26
        Chunk $chunk,
27
        string $type
28
    ) {
29
        parent::__construct($type);
30
        $this->chunk = $chunk;
31
    }
32
33
34
    /**
35
     * Get the raw version of this statement as a Chunk.
36
     *
37
     * @return \SimpleSAML\XML\Chunk
38
     */
39
    public function getRawStatement(): Chunk
40
    {
41
        return $this->chunk;
42
    }
43
44
45
    /**
46
     * Convert this unknown statement to XML.
47
     *
48
     * @param \DOMElement|null $parent The element we are converting to XML.
49
     * @return \DOMElement The XML element after adding the data corresponding to this unknown statement.
50
     */
51
    public function toXML(DOMElement $parent = null): DOMElement
52
    {
53
        return $this->chunk->toXML($parent);
54
    }
55
}
56
57