Passed
Push — static-analysis ( 661417...be3dd0 )
by SignpostMarv
02:22
created

AbstractElementSingle   A

Complexity

Total Complexity 10

Size/Duplication

Total Lines 100
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 100
ccs 20
cts 20
cp 1
rs 10
wmc 10

8 Methods

Rating   Name   Duplication   Size   Complexity  
A isNil() 0 3 1
A isQualified() 0 3 1
A setNil() 0 5 2
A setQualified() 0 5 2
A setMin() 0 5 1
A setMax() 0 5 1
A getMax() 0 3 1
A getMin() 0 3 1
1
<?php
2
3
namespace GoetasWebservices\XML\XSDReader\Schema\Element;
4
5
use GoetasWebservices\XML\XSDReader\Schema\Item;
6
7
class AbstractElementSingle extends Item implements ElementSingle
8
{
9
    /**
10
     * @var int
11
     */
12
    protected $min = 1;
13
14
    /**
15
     * @var int
16
     */
17
    protected $max = 1;
18
19
    /**
20
     * @var bool
21
     */
22
    protected $qualified = true;
23
24
    /**
25
     * @var bool
26
     */
27
    protected $nil = false;
28
29
    /**
30
     * @return bool
31
     */
32 1
    public function isQualified()
33
    {
34 1
        return $this->qualified;
35
    }
36
37
    /**
38
     * @param bool $qualified
39
     *
40
     * @return $this
41
     */
42 3
    public function setQualified($qualified)
43
    {
44 3
        $this->qualified = is_bool($qualified) ? $qualified : (bool) $qualified;
45
46 3
        return $this;
47
    }
48
49
    /**
50
     * @return bool
51
     */
52 1
    public function isNil()
53
    {
54 1
        return $this->nil;
55
    }
56
57
    /**
58
     * @param bool $nil
59
     *
60
     * @return $this
61
     */
62 3
    public function setNil($nil)
63
    {
64 3
        $this->nil = is_bool($nil) ? $nil : (bool) $nil;
65
66 3
        return $this;
67
    }
68
69
    /**
70
     * @return int
71
     */
72 2
    public function getMin()
73
    {
74 2
        return $this->min;
75
    }
76
77
    /**
78
     * @param int $min
79
     *
80
     * @return $this
81
     */
82 45
    public function setMin($min)
83
    {
84 45
        $this->min = $min;
85
86 45
        return $this;
87
    }
88
89
    /**
90
     * @return int
91
     */
92 4
    public function getMax()
93
    {
94 4
        return $this->max;
95
    }
96
97
    /**
98
     * @param int $max
99
     *
100
     * @return $this
101
     */
102 45
    public function setMax($max)
103
    {
104 45
        $this->max = $max;
105
106 45
        return $this;
107
    }
108
}
109