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

VariableDefinitionNode::setVariable()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 1
dl 0
loc 4
rs 10
c 0
b 0
f 0
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