Passed
Push — static-analysis ( 0c4f4f...d5a974 )
by SignpostMarv
03:25
created

Item::getSchema()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 3
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
eloc 1
nc 1
nop 0
crap 1
1
<?php
2
namespace GoetasWebservices\XML\XSDReader\Schema;
3
4
use GoetasWebservices\XML\XSDReader\Schema\Type\Type;
5
use GoetasWebservices\XML\XSDReader\Schema\Schema;
6
use GoetasWebservices\XML\XSDReader\Schema\SchemaItem;
7
use GoetasWebservices\XML\XSDReader\Schema\SchemaItemTrait;
8
9
abstract class Item implements SchemaItem
10
{
11
    use SchemaItemTrait;
12
13
    /**
14
    * @var string
15
    */
16
    protected $name;
17
18
    /**
19
    * @var Type|null
20
    */
21
    protected $type;
22
23
    /**
24
    * @param string $name
25
    */
26 135
    public function __construct(Schema $schema, $name)
27
    {
28 135
        $this->schema = $schema;
29 135
        $this->name = $name;
30 135
    }
31
32
    /**
33
    * @return string
34
    */
35 135
    public function getName()
36
    {
37 135
        return $this->name;
38
    }
39
40
    /**
41
    * @param string $name
42
    *
43
    * @return $this
44
    */
45
    public function setName($name)
46
    {
47
        $this->name = $name;
48
        return $this;
49
    }
50
51
    /**
52
     *
53
     * @return Type|null
54
     */
55 63
    public function getType()
56
    {
57 63
        return $this->type;
58
    }
59
60
    /**
61
    * @return $this
62
    */
63 135
    public function setType(Type $type)
64
    {
65 135
        $this->type = $type;
66 135
        return $this;
67
    }
68
}
69