Completed
Pull Request — master (#18)
by SignpostMarv
02:40
created

Item::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 2
dl 0
loc 4
ccs 3
cts 3
cp 1
crap 1
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace GoetasWebservices\XML\XSDReader\Schema;
4
5
use GoetasWebservices\XML\XSDReader\Schema\Attribute\AttributeItemTrait;
6
use GoetasWebservices\XML\XSDReader\Schema\Type\Type;
7
8
abstract class Item implements SchemaItem
9
{
10
    use AttributeItemTrait;
11
    use SchemaItemTrait;
12
13
    /**
14
     * @var Type|null
15
     */
16
    protected $type;
17
18
    /**
19
     * @param string $name
20
     */
21 45
    public function __construct(Schema $schema, $name)
22
    {
23 45
        $this->schema = $schema;
24 45
        $this->name = $name;
25 45
    }
26
27
    /**
28
     * @return Type|null
29
     */
30 21
    public function getType()
31
    {
32 21
        return $this->type;
33
    }
34
35
    /**
36
     * @return $this
37
     */
38 45
    public function setType(Type $type)
39
    {
40 45
        $this->type = $type;
41
42 45
        return $this;
43
    }
44
}
45