-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathOnResponseSendingEvent.php
62 lines (55 loc) · 1.6 KB
/
OnResponseSendingEvent.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
<?php
namespace Yoanm\JsonRpcServer\Domain\Event\Acknowledge;
use Yoanm\JsonRpcServer\Domain\Event\JsonRpcServerEvent;
use Yoanm\JsonRpcServer\Domain\Model\JsonRpcCall;
use Yoanm\JsonRpcServer\Domain\Model\JsonRpcCallResponse;
/**
* Class OnResponseSendingEvent
*
* Dispatched when a response has been successfully serialized by the endpoint and will be returned
*/
class OnResponseSendingEvent implements JsonRpcServerEvent
{
const EVENT_NAME = 'json_rpc_server_skd.on_response_sending';
/** @var string */
private $responseString;
/** @var JsonRpcCallResponse */
private $jsonRpcCallResponse;
/** @var null|JsonRpcCall */
private $jsonRpcCall = null;
/**
* @param string $responseString
* @param JsonRpcCallResponse $jsonRpcCallResponse
* @param JsonRpcCall|null $jsonRpcCall
*/
public function __construct(
string $responseString,
JsonRpcCallResponse $jsonRpcCallResponse,
JsonRpcCall $jsonRpcCall = null
) {
$this->responseString = $responseString;
$this->jsonRpcCallResponse = $jsonRpcCallResponse;
$this->jsonRpcCall = $jsonRpcCall;
}
/**
* @return string
*/
public function getResponseString() : string
{
return $this->responseString;
}
/**
* @return JsonRpcCallResponse
*/
public function getJsonRpcCallResponse() : JsonRpcCallResponse
{
return $this->jsonRpcCallResponse;
}
/**
* @return null|JsonRpcCall
*/
public function getJsonRpcCall() : ?JsonRpcCall
{
return $this->jsonRpcCall;
}
}