| Total Complexity | 4 |
| Total Lines | 45 |
| Duplicated Lines | 0 % |
| Coverage | 0% |
| 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 | public function __construct(\Exception $exception, JsonRpcRequest $fromJsonRpcRequest = null) |
||
| 29 | } |
||
| 30 | |||
| 31 | /** |
||
| 32 | * @return \Exception |
||
| 33 | */ |
||
| 34 | public function getException() : \Exception |
||
| 35 | { |
||
| 36 | return $this->exception; |
||
| 37 | } |
||
| 38 | |||
| 39 | /** |
||
| 40 | * @return null|JsonRpcRequest |
||
| 41 | */ |
||
| 42 | public function getFromJsonRpcRequest() |
||
| 43 | { |
||
| 44 | return $this->fromJsonRpcRequest; |
||
| 45 | } |
||
| 46 | |||
| 47 | /** |
||
| 48 | * @param \Exception $exception |
||
| 49 | * |
||
| 50 | * @return OnExceptionEvent |
||
| 51 | */ |
||
| 52 | public function setException(\Exception $exception) : OnExceptionEvent |
||
| 57 | } |
||
| 58 | } |
||
| 59 |