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

Block   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 65
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

Changes 0
Metric Value
dl 0
loc 65
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;
7
8
use PHPSA\ControlFlow\Node\AbstractNode;
9
10
class Block
11
{
12
    /**
13
     * @var AbstractNode[]
14
     */
15
    protected $childrens = [];
16
17
    /**
18
     * @var Block|null
19
     */
20
    protected $exit;
21
22
    /**
23
     * @var int
24
     */
25
    protected $id;
26
27
    /**
28
     * @param int $id
29
     */
30
    public function __construct($id)
31
    {
32
        $this->id = $id;
33
    }
34
35
    /**
36
     * @param AbstractNode $node
37
     */
38
    public function addChildren(AbstractNode $node)
39
    {
40
        $this->childrens[] = $node;
41
    }
42
43
    /**
44
     * @param Block $exit
45
     */
46
    public function setExit(Block $exit)
47
    {
48
        $this->exit = $exit;
49
    }
50
51
    /**
52
     * @return AbstractNode[]
53
     */
54
    public function getChildrens()
55
    {
56
        return $this->childrens;
57
    }
58
59
    /**
60
     * @return Block|null
61
     */
62
    public function getExit()
63
    {
64
        return $this->exit;
65
    }
66
67
    /**
68
     * @return int
69
     */
70
    public function getId()
71
    {
72
        return $this->id;
73
    }
74
}
75