Negation::getNode()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 3
rs 10
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Cloudstek\SCIM\FilterParser\AST;
6
7
/**
8
 * Negation (not).
9
 */
10
class Negation extends AbstractNode
11
{
12
    private Node $node;
13
14
    /**
15
     * Negation.
16
     *
17
     * @param Node      $node
18
     * @param Node|null $parent
19
     */
20
    public function __construct(Node $node, ?Node $parent = null)
21
    {
22
        parent::__construct($parent);
23
24
        $this->setNode($node);
25
    }
26
27
    /**
28
     * Get node.
29
     *
30
     * @return Node
31
     */
32
    public function getNode(): Node
33
    {
34
        return $this->node;
35
    }
36
37
    /**
38
     * Set node.
39
     *
40
     * @param Node $node
41
     *
42
     * @return Negation
43
     *
44
     * @internal
45
     */
46
    public function setNode(Node $node): Negation
47
    {
48
        $this->node = $node;
49
        $this->node->setParent($this);
50
51
        return $this;
52
    }
53
}
54