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

Item   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 58
Duplicated Lines 0 %

Test Coverage

Coverage 78.56%

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 58
ccs 11
cts 14
cp 0.7856
rs 10
wmc 5

5 Methods

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