GraphQLFieldEvent::getContext()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 1
c 1
b 0
f 0
dl 0
loc 3
ccs 2
cts 2
cp 1
rs 10
cc 1
nc 1
nop 0
crap 1
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
use Ynlo\GraphQLBundle\Resolver\ResolverContext;
15
16
class GraphQLFieldEvent extends Event
0 ignored issues
show
Deprecated Code introduced by
The class Symfony\Component\EventDispatcher\Event has been deprecated: since Symfony 4.3, use "Symfony\Contracts\EventDispatcher\Event" instead ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-deprecated  annotation

16
class GraphQLFieldEvent extends /** @scrutinizer ignore-deprecated */ Event
Loading history...
17
{
18
    /**
19
     * @var ResolverContext
20
     */
21
    protected $context;
22
23
    /**
24
     * @var mixed|null
25
     */
26
    protected $value;
27
28
    /**
29
     * GraphQLFieldEvent constructor.
30
     *
31
     * @param ResolverContext $context
32
     * @param mixed|null      $value
33
     */
34 2
    public function __construct(ResolverContext $context, $value = null)
35
    {
36 2
        $this->context = $context;
37 2
        $this->value = $value;
38 2
    }
39
40
    /**
41
     * @return ResolverContext
42
     */
43 2
    public function getContext(): ResolverContext
44
    {
45 2
        return $this->context;
46
    }
47
48
    /**
49
     * @return mixed|null
50
     */
51
    public function getValue()
52
    {
53
        return $this->value;
54
    }
55
56
    /**
57
     * @param mixed $value
58
     */
59
    public function setValue($value): void
60
    {
61
        $this->value = $value;
62
    }
63
}
64