| 1 | <?php |
||
| 8 | class JsonRpcResponse implements RpcResponseInterface |
||
| 9 | { |
||
| 10 | const VERSION = '2.0'; |
||
| 11 | |||
| 12 | public $id; |
||
| 13 | public $method; |
||
| 14 | public $attributes; |
||
| 15 | public $error; |
||
| 16 | |||
| 17 | public function __construct(array $attributes = [], JsonRpcGenericErrorException $error = null) |
||
| 22 | |||
| 23 | /** |
||
| 24 | * @return int|string |
||
| 25 | */ |
||
| 26 | public function getId() |
||
| 30 | |||
| 31 | /** |
||
| 32 | * @param int|string $id |
||
| 33 | */ |
||
| 34 | public function setId($id) |
||
| 38 | |||
| 39 | /** |
||
| 40 | * @return string |
||
| 41 | */ |
||
| 42 | public function getMethod() |
||
| 46 | |||
| 47 | /** |
||
| 48 | * @param string $method |
||
| 49 | */ |
||
| 50 | public function setMethod($method) |
||
| 54 | |||
| 55 | /** |
||
| 56 | * @return string |
||
| 57 | */ |
||
| 58 | public function getVersion() |
||
| 62 | |||
| 63 | /** |
||
| 64 | * @return null|array |
||
| 65 | */ |
||
| 66 | public function getError() |
||
| 70 | |||
| 71 | /** |
||
| 72 | * @param JsonRpcGenericErrorException $error |
||
| 73 | */ |
||
| 74 | public function setError(JsonRpcGenericErrorException $error) |
||
| 78 | |||
| 79 | /** |
||
| 80 | * @param $key |
||
| 81 | * @return mixed |
||
| 82 | */ |
||
| 83 | public function get($key) |
||
| 87 | |||
| 88 | public function __toString() |
||
| 104 | } |