Completed
Push — develop ( 32afc4...f78f16 )
by Bartko
03:00
created

Bottom   A

Complexity

Total Complexity 7

Size/Duplication

Total Lines 33
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 3
Bugs 1 Features 0
Metric Value
wmc 7
c 3
b 1
f 0
lcom 1
cbo 2
dl 0
loc 33
ccs 12
cts 12
cp 1
rs 10

6 Methods

Rating   Name   Duplication   Size   Complexity  
A moveIndexesFromIndex() 0 4 1
A newParentId() 0 4 1
A newLevel() 0 4 1
A newLeftIndex() 0 4 1
A newRightIndex() 0 4 1
A canAddNewNode() 0 4 2
1
<?php
2
namespace StefanoTree\NestedSet\AddStrategy;
3
4
class Bottom
5
    extends AddStrategyAbstract
0 ignored issues
show
Coding Style introduced by
The extends keyword must be on the same line as the class name
Loading history...
6
{
7 3
    public function canAddNewNode()
8
    {
9 3
        return ($this->getTargetNode()->isRoot()) ? false : true;
10
    }
11
12 3
    public function moveIndexesFromIndex()
13
    {
14 3
        return $this->getTargetNode()->getRight();
15
    }
16
17 3
    public function newParentId()
18
    {
19 3
        return $this->getTargetNode()->getParentId();
20
    }
21
22 3
    public function newLevel()
23
    {
24 3
        return $this->getTargetNode()->getLevel();
25
    }
26
27 3
    public function newLeftIndex()
28
    {
29 3
        return $this->getTargetNode()->getRight() + 1;
30
    }
31
32 3
    public function newRightIndex()
33
    {
34 3
        return $this->getTargetNode()->getRight() + 2;
35
    }
36
}
37