-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathOnMethodSuccessEvent.php
50 lines (42 loc) · 1.1 KB
/
OnMethodSuccessEvent.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
<?php
namespace Yoanm\JsonRpcServer\Domain\Event\Action;
use Yoanm\JsonRpcServer\Domain\JsonRpcMethodInterface;
use Yoanm\JsonRpcServer\Domain\Model\JsonRpcRequest;
/**
* Class OnMethodSuccessEvent
*
* Dispatched only in case JSON-RPC method has been successfully executed.
*/
class OnMethodSuccessEvent extends AbstractOnMethodEvent
{
const EVENT_NAME = 'json_rpc_server_skd.on_method_success';
/** @var mixed|array|null */
private $result;
/**
* @param mixed $result
* @param JsonRpcMethodInterface $method
* @param JsonRpcRequest $jsonRpcRequest
*/
public function __construct($result, JsonRpcMethodInterface $method, JsonRpcRequest $jsonRpcRequest)
{
$this->result = $result;
parent::__construct($method, $jsonRpcRequest);
}
/**
* @return mixed
*/
public function getResult()
{
return $this->result;
}
/**
* @param mixed $result
*
* @return self
*/
public function setResult($result) : self
{
$this->result = $result;
return $this;
}
}