Completed
Push — master ( da8fcc...d64df6 )
by Asmir
02:56
created

ElementRef::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1
Metric Value
dl 0
loc 5
ccs 4
cts 4
cp 1
rs 9.4285
cc 1
eloc 3
nc 1
nop 1
crap 1
1
<?php
2
namespace GoetasWebservices\XML\XSDReader\Schema\Element;
3
4
use GoetasWebservices\XML\XSDReader\Schema\Item;
5
6
class ElementRef extends Item implements ElementSingle
7
{
8
9
    protected $wrapped;
10
11
    protected $min = 1;
12
13
    protected $max = 1;
14
15
    protected $qualified = true;
16
17
    protected $nil = false;
18
19 39
    public function __construct(ElementDef $element)
20
    {
21 39
        parent::__construct($element->getSchema(), $element->getName());
22 39
        $this->wrapped = $element;
23 39
    }
24
25
    /**
26
     *
27
     * @return ElementDef
28
     */
29
    public function getReferencedElement()
30
    {
31
        return $this->wrapped;
32
    }
33
34
    public function getType()
35
    {
36
        return $this->wrapped->getType();
37
    }
38
39
    public function getMin()
40
    {
41
        return $this->min;
42
    }
43
44 39
    public function setMin($min)
45
    {
46 39
        $this->min = $min;
47 39
        return $this;
48
    }
49
50
    public function getMax()
51
    {
52
        return $this->max;
53
    }
54
55 39
    public function setMax($max)
56
    {
57 39
        $this->max = $max;
58 39
        return $this;
59
    }
60
61
    public function isQualified()
62
    {
63
        return $this->qualified;
64
    }
65
66
    public function setQualified($qualified)
67
    {
68
        $this->qualified = (boolean) $qualified;
69
        return $this;
70
    }
71
72
    public function isNil()
73
    {
74
        return $this->nil;
75
    }
76
77
    public function setNil($nil)
78
    {
79
        $this->nil = (boolean) $nil;
80
        return $this;
81
    }
82
}
83