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

ChildTop   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 2
Bugs 1 Features 0
Metric Value
wmc 5
c 2
b 1
f 0
lcom 1
cbo 2
dl 0
loc 28
ccs 10
cts 10
cp 1
rs 10

5 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
1
<?php
2
namespace StefanoTree\NestedSet\AddStrategy;
3
4
class ChildTop
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 6
    public function moveIndexesFromIndex()
8
    {
9 6
        return $this->getTargetNode()->getLeft();
10
    }
11
12 6
    public function newParentId()
13
    {
14 6
        return $this->getTargetNode()->getId();
15
    }
16
17 6
    public function newLevel()
18
    {
19 6
        return $this->getTargetNode()->getLevel() + 1;
20
    }
21
22 6
    public function newLeftIndex()
23
    {
24 6
        return $this->getTargetNode()->getLeft() + 1;
25
    }
26
27 6
    public function newRightIndex()
28
    {
29 6
        return $this->getTargetNode()->getLeft() + 2;
30
    }
31
}
32