Completed
Push — master ( 217daa...4e747b )
by Siim
11:32
created

RequestCreatedEvent::getResponse()   A

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
 * Created by PhpStorm.
4
 * User: siim
5
 * Date: 14.02.19
6
 * Time: 7:32
7
 */
8
9
namespace Sf4\Api\Event;
10
11
use Sf4\Api\Request\RequestInterface;
12
use Sf4\Api\Response\ResponseInterface;
13
use Symfony\Component\EventDispatcher\Event;
14
15
class RequestCreatedEvent extends Event
16
{
17
    const NAME = 'api.request.created';
18
19
    /** @var RequestInterface */
20
    protected $request;
21
22
    /** @var ResponseInterface|null $response */
23
    protected $response;
24
25
    /**
26
     * RequestCreatedEvent constructor.
27
     * @param RequestInterface $request
28
     */
29
    public function __construct(RequestInterface $request)
30
    {
31
        $this->setRequest($request);
32
    }
33
34
    /**
35
     * @return RequestInterface
36
     */
37
    public function getRequest(): RequestInterface
38
    {
39
        return $this->request;
40
    }
41
42
    /**
43
     * @param RequestInterface $request
44
     */
45
    public function setRequest(RequestInterface $request): void
46
    {
47
        $this->request = $request;
48
    }
49
50
    /**
51
     * @return ResponseInterface|null
52
     */
53
    public function getResponse(): ?ResponseInterface
54
    {
55
        return $this->response;
56
    }
57
58
    /**
59
     * @param ResponseInterface|null $response
60
     */
61
    public function setResponse(?ResponseInterface $response): void
62
    {
63
        $this->response = $response;
64
    }
65
}
66