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