Passed
Pull Request — master (#23)
by Christoffer
02:07 queued 19s
created

VariableDefinitionNode   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 55
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
dl 0
loc 55
rs 10
c 0
b 0
f 0
wmc 4

4 Methods

Rating   Name   Duplication   Size   Complexity  
A getType() 0 3 1
A getVariable() 0 3 1
A setVariable() 0 4 1
A setType() 0 4 1
1
<?php
2
3
namespace Digia\GraphQL\Language\AST\Node;
4
5
use Digia\GraphQL\Language\AST\NodeKindEnum;
6
7
class VariableDefinitionNode extends AbstractNode implements DefinitionNodeInterface
8
{
9
10
    use NameTrait;
11
    use DefaultValueTrait;
12
13
    /**
14
     * @var string
15
     */
16
    protected $kind = NodeKindEnum::VARIABLE_DEFINITION;
17
18
    /**
19
     * @var VariableNode
20
     */
21
    protected $variable;
22
23
    /**
24
     * @var TypeNodeInterface
25
     */
26
    protected $type;
27
28
    /**
29
     * @return VariableNode
30
     */
31
    public function getVariable(): VariableNode
32
    {
33
        return $this->variable;
34
    }
35
36
    /**
37
     * @return TypeNodeInterface
38
     */
39
    public function getType(): TypeNodeInterface
40
    {
41
        return $this->type;
42
    }
43
44
    /**
45
     * @param VariableNode $variable
46
     * @return VariableDefinitionNode
47
     */
48
    public function setVariable(VariableNode $variable): VariableDefinitionNode
49
    {
50
        $this->variable = $variable;
51
        return $this;
52
    }
53
54
    /**
55
     * @param TypeNodeInterface $type
56
     * @return VariableDefinitionNode
57
     */
58
    public function setType(TypeNodeInterface $type): VariableDefinitionNode
59
    {
60
        $this->type = $type;
61
        return $this;
62
    }
63
}
64