Completed
Pull Request — master (#70)
by
unknown
10:33
created

ReturnEvent::getRequest()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
c 0
b 0
f 0
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
/*
3
 * Copyright (c) Nate Brunette.
4
 * Distributed under the MIT License (http://opensource.org/licenses/MIT)
5
 */
6
7
namespace Tebru\Retrofit\Event;
8
9
use Psr\Http\Message\RequestInterface;
10
use Psr\Http\Message\ResponseInterface;
11
use Symfony\Component\EventDispatcher\Event;
12
13
/**
14
 * Class ReturnEvent
15
 *
16
 * @author Nate Brunette <[email protected]>
17
 */
18
class ReturnEvent extends Event
19
{
20
    const NAME = 'retrofit.return';
21
22
    /**
23
     * What will be returned from the generated client
24
     *
25
     * @var mixed
26
     */
27
    private $return;
28
29
    /**
30
     * The request sent to the client
31
     *
32
     * @var RequestInterface
33
     */
34
    private $request;
35
36
    /**
37
     * The response from the client
38
     *
39
     * @var ResponseInterface
40
     */
41
    private $response;
42
43
    /**
44
     * Constructor
45
     *
46
     * @param mixed $return
47
     * @param RequestInterface|null $request
48
     * @param ResponseInterface|null $response
49
     */
50
    public function __construct($return, RequestInterface $request = null, ResponseInterface $response = null)
51
    {
52
        $this->return = $return;
53
        $this->request = $request;
54
        $this->response = $response;
55
    }
56
57
    /**
58
     * Get return
59
     *
60
     * @return mixed
61
     */
62
    public function getReturn()
63
    {
64
        return $this->return;
65
    }
66
67
    /**
68
     * Set updated return back to event
69
     *
70
     * @param mixed $return
71
     */
72
    public function setReturn($return)
73
    {
74
        $this->return = $return;
75
    }
76
77
    /**
78
     * Get the request
79
     *
80
     * @return RequestInterface|null
81
     */
82
    public function getRequest()
83
    {
84
        return $this->request;
85
    }
86
87
    /**
88
     * Get the response
89
     *
90
     * @return ResponseInterface|null
91
     */
92
    public function getResponse()
93
    {
94
        return $this->response;
95
    }
96
}
97