1 | <?php |
||
9 | class RpcRequest implements RpcRequestInterface |
||
10 | { |
||
11 | const VERSION = '2.0'; |
||
12 | |||
13 | public $id; |
||
14 | public $method; |
||
15 | public $attributes; |
||
16 | |||
17 | public function __construct($id = null, $method = null, array $attributes = []) |
||
23 | |||
24 | /** |
||
25 | * @return int|string |
||
26 | */ |
||
27 | public function getId() |
||
31 | |||
32 | /** |
||
33 | * @param int|string $id |
||
34 | */ |
||
35 | public function setId($id) |
||
39 | |||
40 | |||
41 | /** |
||
42 | * @return string |
||
43 | */ |
||
44 | public function getMethod() |
||
48 | |||
49 | /** |
||
50 | * @param string $method |
||
51 | */ |
||
52 | public function setMethod($method) |
||
56 | |||
57 | /** |
||
58 | * @return string |
||
59 | */ |
||
60 | public function getVersion() |
||
64 | |||
65 | /** |
||
66 | * @param $key |
||
67 | * @return mixed |
||
68 | */ |
||
69 | public function get($key) |
||
73 | |||
74 | /** |
||
75 | * @return array |
||
76 | */ |
||
77 | public function toArray() |
||
88 | |||
89 | /** |
||
90 | * @param array $request |
||
91 | * @return $this |
||
92 | * @throws RpcInvalidRequestException |
||
93 | */ |
||
94 | public function fromArray(array $request) |
||
103 | |||
104 | public function validate(array $request) |
||
114 | } |