Completed
Push — master ( e13501...8c19ea )
by Alexandr
05:24
created

VariableReference   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 47
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 5
lcom 0
cbo 0
dl 0
loc 47
ccs 13
cts 13
cp 1
rs 10
c 0
b 0
f 0

5 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A getVariable() 0 4 1
A getValue() 0 4 1
A setValue() 0 4 1
A getName() 0 4 1
1
<?php
2
/**
3
 * Date: 10/24/16
4
 *
5
 * @author Portey Vasil <[email protected]>
6
 */
7
8
namespace Youshido\GraphQL\Parser\Ast\ArgumentValue;
9
10
11
class VariableReference implements ValueInterface
12
{
13
14
    /** @var  string */
15
    private $name;
16
17
    /** @var  Variable */
18
    private $variable;
19
20
    /** @var  mixed */
21
    private $value;
22
23
    /**
24
     * VariableReference constructor.
25
     *
26
     * @param string        $name
27
     * @param Variable|null $variable
28
     */
29 6
    public function __construct($name, Variable $variable = null)
30
    {
31 6
        $this->name     = $name;
32 6
        $this->variable = $variable;
33 6
    }
34
35 6
    public function getVariable()
36
    {
37 6
        return $this->variable;
38
    }
39
40 3
    public function getValue()
41
    {
42 3
        return $this->value;
43
    }
44
45 3
    public function setValue($value)
46
    {
47 3
        $this->value = $value;
48 3
    }
49
50
    /**
51
     * @return string
52
     */
53 1
    public function getName()
54
    {
55 1
        return $this->name;
56
    }
57
}
58