AbstractNode::getParent()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
rs 10
c 0
b 0
f 0
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