Passed
Pull Request — master (#169)
by Quang
02:29
created

Path   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 37
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 3
dl 0
loc 37
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getKey() 0 3 1
A getPrevious() 0 3 1
A __construct() 0 4 1
1
<?php
2
3
namespace Digia\GraphQL\Execution;
4
5
/**
6
 * Class Path
7
 * @package Digia\GraphQL\Execution
8
 */
9
class Path
10
{
11
    /**
12
     * @var Path|null
13
     */
14
    protected $previous;
15
16
    /**
17
     * @var string|mixed
18
     */
19
    protected $key;
20
21
    /**
22
     * Path constructor.
23
     * @param $previous
24
     * @param $key
25
     */
26
    public function __construct($previous, $key)
27
    {
28
        $this->previous = $previous;
29
        $this->key      = $key;
30
    }
31
32
    /**
33
     * @return Path|null
34
     */
35
    public function getPrevious()
36
    {
37
        return $this->previous;
38
    }
39
40
    /**
41
     * @return mixed|string
42
     */
43
    public function getKey()
44
    {
45
        return $this->key;
46
    }
47
}