IndexedElementTrait::setIsDefault()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 1
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace SimpleSAML\SAML2\XML\md;
6
7
use SimpleSAML\XMLSchema\Type\BooleanValue;
8
use SimpleSAML\XMLSchema\Type\UnsignedShortValue;
9
10
/**
11
 * Trait adding methods to handle elements that can be indexed.
12
 *
13
 * @package simplesamlphp/saml2
14
 */
15
trait IndexedElementTrait
16
{
17
    /**
18
     * The index for this endpoint.
19
     *
20
     * @var \SimpleSAML\XMLSchema\Type\UnsignedShortValue
21
     */
22
    protected UnsignedShortValue $index;
23
24
    /**
25
     * Whether this endpoint is the default.
26
     *
27
     * @var \SimpleSAML\XMLSchema\Type\BooleanValue|null
28
     */
29
    protected ?BooleanValue $isDefault = null;
30
31
32
    /**
33
     * Collect the value of the index property.
34
     *
35
     * @return \SimpleSAML\XMLSchema\Type\UnsignedShortValue
36
     */
37
    public function getIndex(): UnsignedShortValue
38
    {
39
        return $this->index;
40
    }
41
42
43
    /**
44
     * Set the value of the index property.
45
     *
46
     * @param \SimpleSAML\XMLSchema\Type\UnsignedShortValue $index
47
     */
48
    protected function setIndex(UnsignedShortValue $index): void
49
    {
50
        $this->index = $index;
51
    }
52
53
54
    /**
55
     * Collect the value of the isDefault property.
56
     *
57
     * @return \SimpleSAML\XMLSchema\Type\BooleanValue|null
58
     */
59
    public function getIsDefault(): ?BooleanValue
60
    {
61
        return $this->isDefault;
62
    }
63
64
65
    /**
66
     * Set the value of the isDefault property.
67
     *
68
     * @param  \SimpleSAML\XMLSchema\Type\BooleanValue|null $flag
69
     */
70
    protected function setIsDefault(?BooleanValue $flag): void
71
    {
72
        $this->isDefault = $flag;
73
    }
74
}
75