getAttributeNamespace()   A
last analyzed

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
eloc 1
c 1
b 0
f 0
dl 0
loc 3
rs 10
cc 1
nc 1
nop 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace SimpleSAML\SAML11\XML\saml;
6
7
use DOMElement;
8
use SimpleSAML\SAML11\Type\SAMLAnyURIValue;
9
use SimpleSAML\SAML11\Type\SAMLStringValue;
10
11
use function strval;
12
13
/**
14
 * SAML AttributeDesignatorType abstract data type.
15
 *
16
 * @package simplesamlphp/saml11
17
 */
18
abstract class AbstractAttributeDesignatorType extends AbstractSamlElement
19
{
20
    /**
21
     * Initialize a saml:AttributeDesignatorType from scratch
22
     *
23
     * @param \SimpleSAML\SAML11\Type\SAMLStringValue $AttributeName
24
     * @param \SimpleSAML\SAML11\Type\SAMLAnyURIValue $AttributeNamespace
25
     */
26
    public function __construct(
27
        protected SAMLStringValue $AttributeName,
28
        protected SAMLAnyURIValue $AttributeNamespace,
29
    ) {
30
    }
31
32
33
    /**
34
     * Collect the value of the AttributeName-property
35
     *
36
     * @return \SimpleSAML\SAML11\Type\SAMLStringValue
37
     */
38
    public function getAttributeName(): SAMLStringValue
39
    {
40
        return $this->AttributeName;
41
    }
42
43
44
    /**
45
     * Collect the value of the AttributeNamespace-property
46
     *
47
     * @return \SimpleSAML\SAML11\Type\SAMLAnyURIValue
48
     */
49
    public function getAttributeNamespace(): SAMLAnyURIValue
50
    {
51
        return $this->AttributeNamespace;
52
    }
53
54
55
    /**
56
     * Convert this AttributeDesignatorType to XML.
57
     *
58
     * @param \DOMElement $parent The element we are converting to XML.
59
     * @return \DOMElement The XML element after adding the data corresponding to this AttributeDesignatorType.
60
     */
61
    public function toXML(?DOMElement $parent = null): DOMElement
62
    {
63
        $e = $this->instantiateParentElement($parent);
64
65
        $e->setAttribute('AttributeName', strval($this->getAttributeName()));
66
        $e->setAttribute('AttributeNamespace', strval($this->getAttributeNamespace()));
67
68
        return $e;
69
    }
70
}
71