Node::setBottom()   A
last analyzed

Complexity

Conditions 3
Paths 2

Size

Total Lines 9
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 4
c 1
b 0
f 0
dl 0
loc 9
rs 10
cc 3
nc 2
nop 1
1
<?php
2
3
namespace Knp\FriendlyContexts\Table;
4
5
class Node
6
{
7
    private $content;
8
    private $top;
9
    private $right;
10
    private $left;
11
    private $bottom;
12
13
    public function getContent()
14
    {
15
        return $this->content;
16
    }
17
18
    public function setContent($content)
19
    {
20
        $this->content = $content;
21
22
        return $this;
23
    }
24
25
    public function getTop()
26
    {
27
        return $this->top;
28
    }
29
30
    public function setTop(Node $top = null)
31
    {
32
        $this->top = $top;
33
34
        if (null !== $top && $this !== $top->getBottom()) {
35
            $top->setBottom($this);
36
        }
37
38
        return $this;
39
    }
40
41
    public function getBottom()
42
    {
43
        return $this->bottom;
44
    }
45
46
    public function setBottom(Node $bottom = null)
47
    {
48
        $this->bottom = $bottom;
49
50
        if (null !== $bottom && $this !== $bottom->getTop()) {
51
            $bottom->setTop($this);
52
        }
53
54
        return $this;
55
    }
56
57
    public function getLeft()
58
    {
59
        return $this->left;
60
    }
61
62
    public function setLeft(Node $left = null)
63
    {
64
        $this->left = $left;
65
66
        if (null !== $left && $this !== $left->getRight()) {
67
            $left->setRight($this);
68
        }
69
70
        return $this;
71
    }
72
73
    public function getRight()
74
    {
75
        return $this->right;
76
    }
77
78
    public function setRight(Node $right = null)
79
    {
80
        $this->right = $right;
81
82
        if (null !== $right && $this !== $right->getLeft()) {
83
            $right->setLeft($this);
84
        }
85
86
        return $this;
87
    }
88
}
89