Passed
Push — master ( 319fcb...7a107a )
by Rafael
04:41
created

GraphQLFieldEvent::getContext()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 3
c 0
b 0
f 0
ccs 0
cts 2
cp 0
rs 10
cc 1
eloc 1
nc 1
nop 0
crap 2
1
<?php
2
/*******************************************************************************
3
 *  This file is part of the GraphQL Bundle package.
4
 *
5
 *  (c) YnloUltratech <[email protected]>
6
 *
7
 *  For the full copyright and license information, please view the LICENSE
8
 *  file that was distributed with this source code.
9
 ******************************************************************************/
10
11
namespace Ynlo\GraphQLBundle\Events;
12
13
use Symfony\Component\EventDispatcher\Event;
14
15
class GraphQLFieldEvent extends Event
16
{
17
18
    /**
19
     * @var GraphQLFieldInfo
20
     */
21
    protected $info;
22
23
    /**
24
     * @var mixed
25
     */
26
    protected $root;
27
28
    /**
29
     * @var array
30
     */
31
    protected $args = [];
32
33
    /**
34
     * @var mixed|null
35
     */
36
    protected $context;
37
38
    /**
39
     * @var mixed|null
40
     */
41
    protected $value;
42
43
    /**
44
     * GraphQLFieldEvent constructor.
45
     *
46
     * @param GraphQLFieldInfo $info
47
     * @param mixed            $root
48
     * @param array            $args
49
     * @param mixed|null       $context
50
     * @param mixed|null       $value
51
     */
52 22
    public function __construct(GraphQLFieldInfo $info, $root, array $args, $context = null, $value = null)
53
    {
54 22
        $this->info = $info;
55 22
        $this->root = $root;
56 22
        $this->args = $args;
57 22
        $this->context = $context;
58 22
        $this->value = $value;
59 22
    }
60
61
    /**
62
     * @return GraphQLFieldInfo
63
     */
64 22
    public function getInfo(): GraphQLFieldInfo
65
    {
66 22
        return $this->info;
67
    }
68
69
    /**
70
     * @return mixed
71
     */
72 3
    public function getRoot()
73
    {
74 3
        return $this->root;
75
    }
76
77
    /**
78
     * @return array
79
     */
80
    public function getArgs(): array
81
    {
82
        return $this->args;
83
    }
84
85
    /**
86
     * @return mixed|null
87
     */
88
    public function getContext()
89
    {
90
        return $this->context;
91
    }
92
93
    /**
94
     * @return mixed|null
95
     */
96 22
    public function getValue()
97
    {
98 22
        return $this->value;
99
    }
100
101
    /**
102
     * @param mixed $value
103
     */
104 22
    public function setValue($value): void
105
    {
106 22
        $this->value = $value;
107 22
    }
108
}
109