Completed
Push — master ( 4b1c9c...cf6085 )
by SignpostMarv
04:26
created

Item   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 35
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
dl 0
loc 35
ccs 9
cts 9
cp 1
rs 10
c 0
b 0
f 0
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A setType() 0 5 1
A getType() 0 3 1
1
<?php
2
3
namespace GoetasWebservices\XML\XSDReader\Schema;
4
5
use GoetasWebservices\XML\XSDReader\Schema\Type\Type;
6
7
abstract class Item implements SchemaItem
8
{
9
    use NamedItemTrait;
10
    use SchemaItemTrait;
11
12
    /**
13
     * @var Type|null
14
     */
15
    protected $type;
16
17
    /**
18
     * @param string $name
19
     */
20 47
    public function __construct(Schema $schema, $name)
21
    {
22 47
        $this->schema = $schema;
23 47
        $this->name = $name;
24 47
    }
25
26
    /**
27
     * @return Type|null
28
     */
29 22
    public function getType()
30
    {
31 22
        return $this->type;
32
    }
33
34
    /**
35
     * @return $this
36
     */
37 47
    public function setType(Type $type)
38
    {
39 47
        $this->type = $type;
40
41 47
        return $this;
42
    }
43
}
44