Passed
Pull Request — master (#305)
by Jaime Pérez
02:20
created

UnknownID   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 5
dl 0
loc 30
rs 10
c 1
b 0
f 0
wmc 2

2 Methods

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