ResolveContext::getValue()   A
last analyzed

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\Lumen\GraphQL\Models;
4
5
use Youshido\GraphQL\Execution\ResolveInfo;
6
7
class ResolveContext
8
{
9
10
    /**
11
     * @var mixed
12
     */
13
    private $value;
14
15
    /**
16
     * @var array
17
     */
18
    private $arguments;
19
20
    /**
21
     * @var ?ResolveInfo
22
     */
23
    private $info;
24
25
    /**
26
     * ResolverContext constructor.
27
     *
28
     * @param mixed            $value
29
     * @param array            $arguments
30
     * @param null|ResolveInfo $info
31
     */
32
    public function __construct($value, array $arguments, ?ResolveInfo $info = null)
33
    {
34
        $this->value     = $value;
35
        $this->arguments = $arguments;
36
        $this->info      = $info;
37
    }
38
39
    /**
40
     * @return mixed
41
     */
42
    public function getValue()
43
    {
44
        return $this->value;
45
    }
46
47
    /**
48
     * @return array
49
     */
50
    public function getArguments()
51
    {
52
        return $this->arguments;
53
    }
54
55
    /**
56
     * @param string $name
57
     * @return mixed|null
58
     */
59
    public function getArgument($name)
60
    {
61
        return $this->arguments[$name] ?? null;
62
    }
63
64
    /**
65
     * @return null|ResolveInfo
66
     */
67
    public function getInfo()
68
    {
69
        return $this->info;
70
    }
71
}
72