UnknownID   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 35
Duplicated Lines 0 %

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 7 1
A getRawIdentifier() 0 3 1
A toXML() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace SimpleSAML\SAML2\XML\saml;
6
7
use DOMElement;
8
use SimpleSAML\SAML2\Type\SAMLStringValue;
9
use SimpleSAML\XML\Chunk;
10
use SimpleSAML\XMLSchema\Type\QNameValue;
0 ignored issues
show
Bug introduced by
The type SimpleSAML\XMLSchema\Type\QNameValue was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
11
12
/**
13
 * Class for unknown identifiers.
14
 *
15
 * @package simplesamlphp/saml2
16
 */
17
final class UnknownID extends AbstractBaseID
18
{
19
    /**
20
     * @param \SimpleSAML\XML\Chunk $chunk The whole BaseID element as a chunk object.
21
     * @param \SimpleSAML\XMLSchema\Type\QNameValue $type The xsi:type of this identifier.
22
     * @param \SimpleSAML\SAML2\Type\SAMLStringValue|null $NameQualifier
23
     * @param \SimpleSAML\SAML2\Type\SAMLStringValue|null $SPNameQualifier
24
     */
25
    public function __construct(
26
        protected Chunk $chunk,
27
        QNameValue $type,
28
        ?SAMLStringValue $NameQualifier = null,
29
        ?SAMLStringValue $SPNameQualifier = null,
30
    ) {
31
        parent::__construct($type, $NameQualifier, $SPNameQualifier);
32
    }
33
34
35
    /**
36
     * Get the raw version of this identifier as a Chunk
37
     *
38
     * @return \SimpleSAML\XML\Chunk
39
     */
40
    public function getRawIdentifier(): Chunk
41
    {
42
        return $this->chunk;
43
    }
44
45
46
    /**
47
     * Convert this unknown ID to XML.
48
     */
49
    public function toXML(?DOMElement $parent = null): DOMElement
50
    {
51
        return $this->getRawIdentifier()->toXML($parent);
52
    }
53
}
54