Completed
Push — develop ( 4ea5a3...a8c617 )
by Bartko
05:56
created

AddStrategyAbstract   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getTargetNode() 0 4 1
A canAddNewNode() 0 4 1
1
<?php
2
namespace StefanoTree\NestedSet\AddStrategy;
3
4
use StefanoTree\NestedSet\NodeInfo;
5
6
abstract class AddStrategyAbstract
7
    implements AddStrategyInterface
0 ignored issues
show
Coding Style introduced by
The implements keyword must be on the same line as the class name
Loading history...
8
{
9
    protected $targetNode;
10
11
    /**
12
     * @param NodeInfo $targetNode
13
     */
14 12
    public function __construct(NodeInfo $targetNode)
15
    {
16 12
        $this->targetNode = $targetNode;
17 12
    }
18
19
    /**
20
     * @return NodeInfo
21
     */
22 12
    protected function getTargetNode()
23
    {
24 12
        return $this->targetNode;
25
    }
26
27 6
    public function canAddNewNode($rootNodeId)
28
    {
29 6
        return true;
30
    }
31
}
32