Passed
Push — master ( 0d1817...6f3593 )
by Iakov
02:35
created

CrudEvent::getResponse()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 3
rs 10
c 0
b 0
f 0
cc 1
eloc 1
nc 1
nop 0
1
<?php
2
3
namespace Kami\ApiCoreBundle\Event;
4
5
use Symfony\Component\EventDispatcher\Event;
6
use Symfony\Component\HttpFoundation\Request;
7
use Symfony\Component\HttpFoundation\Response;
8
9
/**
10
 * Class CrudEvent
11
 *
12
 * @package Kami\ApiCoreBundle\Event
13
 */
14
class CrudEvent extends Event
15
{
16
    /**
17
     * @var \ReflectionClass
18
     */
19
    protected $reflection;
20
21
    /**
22
     * @var Request
23
     */
24
    protected $request;
25
26
    /**
27
     * @var Response
28
     */
29
    protected $response;
30
31
    /**
32
     * @var object
33
     */
34
    protected $data;
35
36
    /**
37
     * CrudEvent constructor.
38
     * @param \ReflectionClass $reflection
39
     * @param Request $request
40
     * @param null|Response $response
41
     * @param null|mixed $data
42
     */
43
    public function __construct(\ReflectionClass $reflection, Request $request, $response = null, $data = null)
44
    {
45
        $this->reflection = $reflection;
46
        $this->request = $request;
47
        $this->response = $response;
48
        $this->data = $data;
49
    }
50
51
    /**
52
     * @return Request
53
     */
54
    public function getRequest()
55
    {
56
        return $this->request;
57
    }
58
59
    /**
60
     * @return \ReflectionClass
61
     */
62
    public function getReflection()
63
    {
64
        return $this->reflection;
65
    }
66
67
    /**
68
     * @return null|Response
69
     */
70
    public function getResponse()
71
    {
72
        return $this->response;
73
    }
74
75
    /**
76
     * @return null|object
77
     */
78
    public function getData()
79
    {
80
        return $this->data;
81
    }
82
}