AbstractNode   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 6
dl 0
loc 22
rs 10
c 0
b 0
f 0
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A hasParent() 0 3 1
A setParent() 0 5 1
A getParent() 0 3 1
1
<?php
2
/**
3
 * Copyright © Thomas Klein, All rights reserved.
4
 * See LICENSE bundled with this library for license details.
5
 */
6
declare(strict_types=1);
7
8
namespace LogicTree\Node;
9
10
abstract class AbstractNode implements NodeInterface
11
{
12
    /**
13
     * @var null|CombineInterface
14
     */
15
    private $parent;
16
17
    public function getParent(): ?CombineInterface
18
    {
19
        return $this->parent;
20
    }
21
22
    public function setParent(?CombineInterface $combine): NodeInterface
23
    {
24
        $this->parent = $combine;
25
26
        return $this;
27
    }
28
29
    public function hasParent(): bool
30
    {
31
        return $this->parent !== null;
32
    }
33
}
34