Passed
Pull Request — master (#281)
by Sam
03:28
created

VisitorResult::getAction()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Digia\GraphQL\Language\Visitor;
4
5
use Digia\GraphQL\Language\Node\NodeInterface;
6
7
class VisitorResult
8
{
9
10
    public const ACTION_NO_ACTION = 'NO_ACTION';
11
    public const ACTION_BREAK     = 'BREAK';
12
    public const ACTION_REPLACE   = 'REPLACE';
13
14
    /**
15
     * @var NodeInterface|null
16
     */
17
    protected $value;
18
19
    /**
20
     * @var string
21
     */
22
    protected $action;
23
24
    /**
25
     * @param NodeInterface|null $value
26
     * @param string             $action
27
     */
28
    public function __construct(?NodeInterface $value = null, string $action = self::ACTION_NO_ACTION)
29
    {
30
        $this->value  = $value;
31
        $this->action = $action;
32
    }
33
34
    /**
35
     * @return NodeInterface|null
36
     */
37
    public function getValue(): ?NodeInterface
38
    {
39
        return $this->value;
40
    }
41
42
    /**
43
     * @return string
44
     */
45
    public function getAction(): string
46
    {
47
        return $this->action;
48
    }
49
50
    /**
51
     * @param string $action
52
     * @return self
53
     */
54
    public function setAction(string $action): self
55
    {
56
        $this->action = $action;
57
58
        return $this;
59
    }
60
}
61