Issues (281)

src/Events/GraphQLMutationEvent.php (1 issue)

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 Symfony\Component\Form\FormEvent;
15
use Ynlo\GraphQLBundle\Resolver\ResolverContext;
16
17
class GraphQLMutationEvent 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

17
class GraphQLMutationEvent extends /** @scrutinizer ignore-deprecated */ Event
Loading history...
18
{
19
    /**
20
     * @var ResolverContext
21
     */
22
    protected $context;
23
24
    /**
25
     * @var FormEvent
26
     */
27
    protected $formEvent;
28
29
    /**
30
     * @var mixed
31
     */
32
    protected $payload;
33
34
    /**
35
     * GraphQLMutationEvent constructor.
36
     *
37
     * @param ResolverContext $context
38
     * @param FormEvent       $formEvent
39
     */
40
    public function __construct(ResolverContext $context, FormEvent $formEvent)
41
    {
42
        $this->context = $context;
43
        $this->formEvent = $formEvent;
44
    }
45
46
    /**
47
     * @return ResolverContext
48
     */
49
    public function getContext(): ResolverContext
50
    {
51
        return $this->context;
52
    }
53
54
    /**
55
     * @return FormEvent
56
     */
57
    public function getFormEvent(): FormEvent
58
    {
59
        return $this->formEvent;
60
    }
61
62
    /**
63
     * @return mixed
64
     */
65
    public function getPayload()
66
    {
67
        return $this->payload;
68
    }
69
70
    /**
71
     * @param mixed $payload
72
     *
73
     * @return GraphQLMutationEvent
74
     */
75
    public function setPayload($payload)
76
    {
77
        $this->payload = $payload;
78
79
        return $this;
80
    }
81
}
82