| Total Complexity | 4 |
| Total Lines | 45 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 0 | ||
| 1 | <?php |
||
| 12 | class OnExceptionEvent implements JsonRpcServerEvent |
||
| 13 | { |
||
| 14 | const EVENT_NAME = 'json_rpc_server_skd.on_exception'; |
||
| 15 | |||
| 16 | /** @var \Exception */ |
||
| 17 | private $exception; |
||
| 18 | /** @var null|JsonRpcRequest */ |
||
| 19 | private $fromJsonRpcRequest; |
||
| 20 | |||
| 21 | /** |
||
| 22 | * @param \Exception $exception |
||
| 23 | * @param JsonRpcRequest|null $fromJsonRpcRequest |
||
| 24 | */ |
||
| 25 | 3 | public function __construct(\Exception $exception, JsonRpcRequest $fromJsonRpcRequest = null) |
|
| 29 | 3 | } |
|
| 30 | |||
| 31 | /** |
||
| 32 | * @return \Exception |
||
| 33 | */ |
||
| 34 | 2 | public function getException() : \Exception |
|
| 35 | { |
||
| 36 | 2 | return $this->exception; |
|
| 37 | } |
||
| 38 | |||
| 39 | /** |
||
| 40 | * @return null|JsonRpcRequest |
||
| 41 | */ |
||
| 42 | 1 | public function getFromJsonRpcRequest() |
|
| 43 | { |
||
| 44 | 1 | return $this->fromJsonRpcRequest; |
|
| 45 | } |
||
| 46 | |||
| 47 | /** |
||
| 48 | * @param \Exception $exception |
||
| 49 | * |
||
| 50 | * @return OnExceptionEvent |
||
| 51 | */ |
||
| 52 | 1 | public function setException(\Exception $exception) : OnExceptionEvent |
|
| 57 | } |
||
| 58 | } |
||
| 59 |