AbstractNode::hasParent()   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 © 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