Node   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 46
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 10
dl 0
loc 46
rs 10
c 0
b 0
f 0
wmc 4

4 Methods

Rating   Name   Duplication   Size   Complexity  
A getLeft() 0 3 1
A getValue() 0 3 1
A getRight() 0 3 1
A __construct() 0 5 1
1
<?php
2
3
/*
4
 * This file is part of the slince/tree-samples package.
5
 *
6
 * (c) Slince <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Slince\Tree;
13
14
class Node
15
{
16
    /**
17
     * @var int
18
     */
19
    protected $value;
20
21
    /**
22
     * @var Node
23
     */
24
    protected $left;
25
26
    /**
27
     * @var Node
28
     */
29
    protected $right;
30
31
    public function __construct($value, $left = null, $right = null)
32
    {
33
        $this->value = $value;
34
        $this->left = $left;
35
        $this->right = $right;
36
    }
37
38
    /**
39
     * @return int
40
     */
41
    public function getValue()
42
    {
43
        return $this->value;
44
    }
45
46
    /**
47
     * @return Node
48
     */
49
    public function getLeft()
50
    {
51
        return $this->left;
52
    }
53
54
    /**
55
     * @return Node
56
     */
57
    public function getRight()
58
    {
59
        return $this->right;
60
    }
61
}