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

Item   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 35
Duplicated Lines 0 %

Test Coverage

Coverage 75%

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A setType() 0 4 1
A __construct() 0 4 1
A getType() 0 3 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 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