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

AddStrategyAbstract::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 2
Bugs 1 Features 0
Metric Value
c 2
b 1
f 0
dl 0
loc 4
ccs 3
cts 3
cp 1
rs 10
cc 1
eloc 2
nc 1
nop 1
crap 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