Passed
Push — static-analysis ( d5a974...87b144 )
by SignpostMarv
03:37
created

Item::getName()   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\Attribute\AttributeItemTrait;
5
use GoetasWebservices\XML\XSDReader\Schema\Type\Type;
6
use GoetasWebservices\XML\XSDReader\Schema\Schema;
7
use GoetasWebservices\XML\XSDReader\Schema\SchemaItem;
8
use GoetasWebservices\XML\XSDReader\Schema\SchemaItemTrait;
9
10
abstract class Item implements SchemaItem
11
{
12
    use AttributeItemTrait;
13
    use SchemaItemTrait;
14
15
    /**
16
    * @var Type|null
17
    */
18
    protected $type;
19
20
    /**
21
    * @param string $name
22
    */
23 135
    public function __construct(Schema $schema, $name)
24
    {
25 135
        $this->schema = $schema;
26 135
        $this->name = $name;
27 135
    }
28
29
    /**
30
     *
31
     * @return Type|null
32
     */
33 63
    public function getType()
34
    {
35 63
        return $this->type;
36
    }
37
38
    /**
39
    * @return $this
40
    */
41 135
    public function setType(Type $type)
42
    {
43 135
        $this->type = $type;
44 135
        return $this;
45
    }
46
}
47