Test Failed
Pull Request — master (#18)
by SignpostMarv
02:37
created

Item::setName()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 5
c 0
b 0
f 0
ccs 0
cts 3
cp 0
rs 9.4285
cc 1
eloc 3
nc 1
nop 1
crap 2
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 45
20
    /**
21 45
    * @param string $name
22 45
    */
23 45
    public function __construct(Schema $schema, $name)
24
    {
25 45
        $this->schema = $schema;
26
        $this->name = $name;
27 45
    }
28
29
    /**
30
     *
31
     * @return Type|null
32
     */
33
    public function getType()
34
    {
35
        return $this->type;
36
    }
37
38
    /**
39 21
    * @return $this
40
    */
41 21
    public function setType(Type $type)
42
    {
43
        $this->type = $type;
44 45
        return $this;
45
    }
46
}
47