ValuePath::getAttributePath()   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
nc 1
nop 0
dl 0
loc 3
rs 10
c 1
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Cloudstek\SCIM\FilterParser\AST;
6
7
/**
8
 * Value path.
9
 */
10
class ValuePath extends AbstractNode implements Path
11
{
12
    private AttributePath $attributePath;
13
14
    private Node $node;
15
16
    /**
17
     * Value path..
18
     *
19
     * @param AttributePath $attributePath
20
     * @param Node          $node
21
     * @param Node|null     $parent
22
     */
23
    public function __construct(
24
        AttributePath $attributePath,
25
        Node $node,
26
        ?Node $parent = null
27
    ) {
28
        parent::__construct($parent);
29
30
        $this->attributePath = $attributePath;
31
32
        $this->node = $node;
33
        $this->node->setParent($this);
34
    }
35
36
    /**
37
     * Get attribute path.
38
     *
39
     * @return AttributePath
40
     */
41
    public function getAttributePath(): AttributePath
42
    {
43
        return $this->attributePath;
44
    }
45
46
    /**
47
     * Set attribute path.
48
     *
49
     * @param AttributePath $attributePath
50
     *
51
     * @return ValuePath
52
     *
53
     * @internal
54
     */
55
    public function setAttributePath(AttributePath $attributePath): ValuePath
56
    {
57
        $this->attributePath = $attributePath;
58
59
        return $this;
60
    }
61
62
    /**
63
     * Get node.
64
     *
65
     * @return Node
66
     */
67
    public function getNode(): Node
68
    {
69
        return $this->node;
70
    }
71
}
72