Passed
Pull Request — master (#61)
by Tim
02:17
created

MaxOccursTrait   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A setMaxOccurs() 0 3 1
A getMaxOccurs() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace SimpleSAML\XMLSchema\XML\xs;
6
7
use SimpleSAML\XMLSchema\Type\MaxOccursValue;
8
9
/**
10
 * Trait grouping common functionality for elements that can hold a maxOccurs attribute.
11
 *
12
 * @package simplesamlphp/xml-common
13
 */
14
trait MaxOccursTrait
15
{
16
    /**
17
     * The maxOccurs.
18
     *
19
     * @var \SimpleSAML\XMLSchema\Type\MaxOccursValue|null
20
     */
21
    protected ?MaxOccursValue $maxOccurs = null;
22
23
24
    /**
25
     * Collect the value of the maxOccurs-property
26
     *
27
     * @return \SimpleSAML\XMLSchema\Type\MaxOccursValue|null
28
     */
29
    public function getMaxOccurs(): ?MaxOccursValue
30
    {
31
        return $this->maxOccurs;
32
    }
33
34
35
    /**
36
     * Set the value of the maxOccurs-property
37
     *
38
     * @param \SimpleSAML\XMLSchema\Type\MaxOccursValue|null $maxOccurs
39
     */
40
    protected function setMaxOccurs(?MaxOccursValue $maxOccurs): void
41
    {
42
        $this->maxOccurs = $maxOccurs;
43
    }
44
}
45