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

Block::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 1
dl 0
loc 4
rs 10
c 0
b 0
f 0
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