Issues (51)

Event/AdminEvent.php (1 issue)

1
<?php
2
3
/**
4
 * (c) FSi sp. z o.o. <[email protected]>
5
 *
6
 * For the full copyright and license information, please view the LICENSE
7
 * file that was distributed with this source code.
8
 */
9
10
declare(strict_types=1);
11
12
namespace FSi\Bundle\AdminBundle\Event;
13
14
use FSi\Bundle\AdminBundle\Admin\Element;
15
use Symfony\Component\EventDispatcher\Event;
16
use Symfony\Component\HttpFoundation\Request;
17
use Symfony\Component\HttpFoundation\Response;
18
19
class AdminEvent 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

19
class AdminEvent extends /** @scrutinizer ignore-deprecated */ Event
Loading history...
20
{
21
    /**
22
     * @var Element
23
     */
24
    protected $element;
25
26
    /**
27
     * @var Request
28
     */
29
    protected $request;
30
31
    /**
32
     * @var Response|null
33
     */
34
    protected $response;
35
36
    /**
37
     * @param Element $element
38
     * @param Request $request
39
     */
40
    public function __construct(Element $element, Request $request)
41
    {
42
        $this->element = $element;
43
        $this->request = $request;
44
    }
45
46
    public function getElement(): Element
47
    {
48
        return $this->element;
49
    }
50
51
    public function getRequest(): Request
52
    {
53
        return $this->request;
54
    }
55
56
    public function hasResponse(): bool
57
    {
58
        return null !== $this->response;
59
    }
60
61
    public function setResponse(Response $response): void
62
    {
63
        $this->response = $response;
64
    }
65
66
    public function getResponse(): ?Response
67
    {
68
        return $this->response;
69
    }
70
}
71