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

Top::newParentId()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 2
Bugs 1 Features 0
Metric Value
c 2
b 1
f 0
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
cc 1
eloc 2
nc 1
nop 0
crap 1
1
<?php
2
namespace StefanoTree\NestedSet\AddStrategy;
3
4
class Top
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()->getLeft() - 1;
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()->getLeft();
30
    }
31
32 3
    public function newRightIndex()
33
    {
34 3
        return $this->getTargetNode()->getLeft() + 1;
35
    }
36
}
37