Completed
Push — php-7.1 ( d2218e...926e65 )
by SignpostMarv
08:16
created

Attribute::loadAttribute()   A

Complexity

Conditions 4
Paths 8

Size

Total Lines 20
Code Lines 10

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 10
CRAP Score 4

Importance

Changes 0
Metric Value
cc 4
eloc 10
nc 8
nop 3
dl 0
loc 20
ccs 10
cts 10
cp 1
crap 4
rs 9.2
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace GoetasWebservices\XML\XSDReader\Schema\Attribute;
6
7
use GoetasWebservices\XML\XSDReader\Schema\Item;
8
9
class Attribute extends Item implements AttributeSingle
10
{
11
    /**
12
     * @var self|null
13
     */
14
    protected $fixed;
15
16
    /**
17
     * @var self|null
18
     */
19
    protected $default;
20
21
    /**
22
     * @var bool
23
     */
24
    protected $qualified = true;
25
26
    /**
27
     * @var bool
28
     */
29
    protected $nil = false;
30
31
    /**
32
     * @var string
33
     */
34
    protected $use = self::USE_OPTIONAL;
35
36
    /**
37
     * @return self|null
38
     */
39
    public function getFixed(): ? self
40
    {
41
        return $this->fixed;
42
    }
43
44
    /**
45
     * @return $this
46
     */
47
    public function setFixed(Attribute $fixed): self
48
    {
49
        $this->fixed = $fixed;
50
51
        return $this;
52
    }
53
54
    /**
55
     * @return self|null
56
     */
57
    public function getDefault(): ? self
58
    {
59
        return $this->default;
60
    }
61
62
    /**
63
     * @return $this
64
     */
65
    public function setDefault(Attribute $default): self
66
    {
67
        $this->default = $default;
68
69
        return $this;
70
    }
71
72
    public function isQualified(): bool
73
    {
74
        return $this->qualified;
75
    }
76
77
    /**
78
     * {@inheritdoc}
79
     */
80 1
    public function setQualified(bool $qualified): AttributeSingle
81
    {
82 1
        $this->qualified = $qualified;
83
84
        return $this;
85
    }
86
87
    public function isNil(): bool
88 1
    {
89
        return $this->nil;
90 1
    }
91
92 1
    /**
93
     * {@inheritdoc}
94
     */
95 1
    public function setNil(bool $nil): AttributeSingle
96
    {
97 1
        $this->nil = $nil;
98
99
        return $this;
100
    }
101
102
    public function getUse(): string
103 1
    {
104
        return $this->use;
105 1
    }
106
107 1
    /**
108
     * {@inheritdoc}
109
     */
110 1
    public function setUse(string $use): AttributeSingle
111
    {
112 1
        $this->use = $use;
113
114
        return $this;
115
    }
116
}
117