AbstractNode   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getParent() 0 3 1
A hasParent() 0 3 1
A setParent() 0 5 1
1
<?php
2
/**
3
 * Copyright © 2018 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
/**
11
 * Class AbstractCondition
12
 */
13
abstract class AbstractNode implements NodeInterface
14
{
15
    /**
16
     * @var null|\LogicTree\Node\CombineInterface
17
     */
18
    private $parent;
19
20
    /**
21
     * {@inheritdoc}
22
     */
23
    public function getParent(): ?CombineInterface
24
    {
25
        return $this->parent;
26
    }
27
28
    /**
29
     * {@inheritdoc}
30
     */
31
    public function setParent(?CombineInterface $combine): NodeInterface
32
    {
33
        $this->parent = $combine;
34
35
        return $this;
36
    }
37
38
    /**
39
     * {@inheritdoc}
40
     */
41
    public function hasParent(): bool
42
    {
43
        return $this->parent !== null;
44
    }
45
}
46