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

Item   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 35
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
dl 0
loc 35
ccs 9
cts 9
cp 1
rs 10
c 0
b 0
f 0
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
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