Completed
Pull Request — master (#293)
by Дмитрий
02:30
created

Block   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 50
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

Changes 0
Metric Value
dl 0
loc 50
rs 10
c 0
b 0
f 0
wmc 6
lcom 1
cbo 0

6 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A addChildren() 0 4 1
A setExit() 0 4 1
A getChildrens() 0 4 1
A getExit() 0 4 1
A getId() 0 4 1
1
<?php
2
/**
3
 * @author Patsura Dmitry https://github.com/ovr <[email protected]>
4
 */
5
6
namespace PHPSA\ControlFlow\Graph;
7
8
class Block
9
{
10
    protected $childrens = [];
11
12
    protected $exit;
13
14
    protected $id;
15
16
    public function __construct($id)
17
    {
18
        $this->id = $id;
19
    }
20
21
    public function addChildren($node)
22
    {
23
        $this->childrens[] = $node;
24
    }
25
26
    /**
27
     * @param Block $exit
28
     */
29
    public function setExit(Block $exit)
30
    {
31
        $this->exit = $exit;
32
    }
33
34
    /**
35
     * @return array
36
     */
37
    public function getChildrens()
38
    {
39
        return $this->childrens;
40
    }
41
42
    /**
43
     * @return Block
44
     */
45
    public function getExit()
46
    {
47
        return $this->exit;
48
    }
49
50
    /**
51
     * @return mixed
52
     */
53
    public function getId()
54
    {
55
        return $this->id;
56
    }
57
}
58