Completed
Push — master ( c02262...67efd2 )
by Milos
17s queued 16s
created

ValuePath::getFilter()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
/*
4
 * This file is part of the tmilos/scim-filter-parser package.
5
 *
6
 * (c) Milos Tomic <[email protected]>
7
 *
8
 * This source file is subject to the MIT license that is bundled
9
 * with this source code in the file LICENSE.
10
 */
11
12
namespace Tmilos\ScimFilterParser\Ast;
13
14
class ValuePath extends Factor
15
{
16
    /** @var AttributePath */
17
    private $attributePath;
18
19
    /** @var Filter */
20
    private $filter;
21
22
    /**
23
     * @param AttributePath $attributePath
24
     * @param Filter        $filter
25
     */
26
    public function __construct(AttributePath $attributePath, Filter $filter)
27
    {
28
        $this->attributePath = $attributePath;
29
        $this->filter = $filter;
30
    }
31
32
    /**
33
     * @return AttributePath
34
     */
35
    public function getAttributePath()
36
    {
37
        return $this->attributePath;
38
    }
39
40
    /**
41
     * @return Filter
42
     */
43
    public function getFilter()
44
    {
45
        return $this->filter;
46
    }
47
48
    public function __toString()
49
    {
50
        return sprintf('%s[%s]', $this->attributePath, $this->filter);
51
    }
52
53
    public function dump()
54
    {
55
        return [
56
            'ValuePath' => [
57
                $this->attributePath->dump(),
58
                $this->filter->dump(),
59
            ],
60
        ];
61
    }
62
}
63