SimpleType   A
last analyzed

Complexity

Total Complexity 6

Size/Duplication

Total Lines 48
Duplicated Lines 0 %

Test Coverage

Coverage 85.71%

Importance

Changes 2
Bugs 1 Features 0
Metric Value
wmc 6
eloc 10
c 2
b 1
f 0
dl 0
loc 48
ccs 12
cts 14
cp 0.8571
rs 10

6 Methods

Rating   Name   Duplication   Size   Complexity  
A getRestriction() 0 3 1
A getList() 0 3 1
A setList() 0 3 1
A getUnions() 0 3 1
A addUnion() 0 3 1
A setRestriction() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace GoetasWebservices\XML\XSDReader\Schema\Type;
6
7
use GoetasWebservices\XML\XSDReader\Schema\Inheritance\Restriction;
8
9
class SimpleType extends Type
10
{
11
    /**
12
     * @var Restriction|null
13
     */
14
    protected $restriction;
15
16
    /**
17
     * @var SimpleType[]
18
     */
19
    protected $unions = [];
20
21
    /**
22
     * @var SimpleType|null
23
     */
24
    protected $list;
25
26 15
    public function getRestriction(): ?Restriction
27
    {
28 15
        return $this->restriction;
29
    }
30
31 74
    public function setRestriction(Restriction $restriction): void
32
    {
33 74
        $this->restriction = $restriction;
34 74
    }
35
36 74
    public function addUnion(self $type): void
37
    {
38 74
        $this->unions[] = $type;
39 74
    }
40
41
    /**
42
     * @return SimpleType[]
43
     */
44 2
    public function getUnions(): array
45
    {
46 2
        return $this->unions;
47
    }
48
49
    public function getList(): ?self
50
    {
51
        return $this->list;
52
    }
53
54 74
    public function setList(self $list): void
55
    {
56 74
        $this->list = $list;
57 74
    }
58
}
59