Completed
Pull Request — master (#35)
by Aleh
03:05
created

Chain   A

Complexity

Total Complexity 7

Size/Duplication

Total Lines 48
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 7
c 1
b 0
f 0
lcom 0
cbo 0
dl 0
loc 48
rs 10

6 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 9 2
A getName() 0 4 1
A getType() 0 4 1
A getParent() 0 4 1
A getChild() 0 4 1
A setParent() 0 4 1
1
<?php
2
3
namespace Padawan\Domain\Project;
4
5
class Chain
6
{
7
    public function __construct(Chain $child = null, $name = "", $type = "")
8
    {
9
        $this->child = $child;
10
        $this->name = $name;
11
        $this->type = $type;
12
        if ($child instanceof Chain) {
13
            $child->setParent($this);
14
        }
15
    }
16
17
    public function getName()
18
    {
19
        return $this->name;
20
    }
21
22
    public function getType()
23
    {
24
        return $this->type;
25
    }
26
27
    /**
28
     * @return Chain
29
     */
30
    public function getParent()
31
    {
32
        return $this->parent;
33
    }
34
35
    /**
36
     * @return Chain
37
     */
38
    public function getChild()
39
    {
40
        return $this->child;
41
    }
42
43
    public function setParent(Chain $parent)
44
    {
45
        $this->parent = $parent;
46
    }
47
48
    private $type;
49
    private $name;
50
    private $parent;
51
    private $child;
52
}
53