| 1 | <?php |
||
| 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) |
||
| 56 | |||
| 57 | /** |
||
| 58 | * Get return |
||
| 59 | * |
||
| 60 | * @return mixed |
||
| 61 | */ |
||
| 62 | public function getReturn() |
||
| 66 | |||
| 67 | /** |
||
| 68 | * Set updated return back to event |
||
| 69 | * |
||
| 70 | * @param mixed $return |
||
| 71 | */ |
||
| 72 | public function setReturn($return) |
||
| 76 | |||
| 77 | /** |
||
| 78 | * Get the request |
||
| 79 | * |
||
| 80 | * @return RequestInterface|null |
||
| 81 | */ |
||
| 82 | public function getRequest() |
||
| 86 | |||
| 87 | /** |
||
| 88 | * Get the response |
||
| 89 | * |
||
| 90 | * @return ResponseInterface|null |
||
| 91 | */ |
||
| 92 | public function getResponse() |
||
| 96 | } |
||
| 97 |