1 | <?php |
||
7 | final class JsonRpcRequest implements JsonRpcRequestInterface |
||
8 | { |
||
9 | /** @var string */ |
||
10 | private $id; |
||
11 | /** @var string */ |
||
12 | private $method; |
||
13 | /** @var \stdClass|array|null */ |
||
14 | private $parameters; |
||
15 | |||
16 | /** |
||
17 | * JsonRpcRequest constructor. |
||
18 | * |
||
19 | * @param string $method |
||
20 | * @param \stdClass|array|null $parameters |
||
21 | * @param string $id |
||
22 | * |
||
23 | * @throws \InvalidArgumentException |
||
24 | */ |
||
25 | 16 | public function __construct($method, $parameters = null, $id) |
|
37 | |||
38 | /** |
||
39 | * @param RpcRequestInterface $request |
||
40 | * @param string $id |
||
41 | * |
||
42 | * @return static |
||
43 | * |
||
44 | * @throws \InvalidArgumentException |
||
45 | */ |
||
46 | 1 | public static function fromRpcRequest(RpcRequestInterface $request, $id) |
|
50 | |||
51 | /** {@inheritdoc} */ |
||
52 | 4 | public function isNotification() |
|
56 | |||
57 | /** {@inheritdoc} */ |
||
58 | 16 | public function getId() |
|
62 | |||
63 | /** {@inheritdoc} */ |
||
64 | 16 | public function getMethod() |
|
68 | |||
69 | /** {@inheritdoc} */ |
||
70 | 16 | public function getParameters() |
|
74 | |||
75 | /** |
||
76 | * {@inheritdoc} |
||
77 | */ |
||
78 | 16 | public function jsonSerialize() |
|
87 | |||
88 | /** |
||
89 | * Returns version of the JSON-RPC request |
||
90 | * |
||
91 | * A String specifying the version of the JSON-RPC protocol. MUST be exactly "2.0". |
||
92 | * |
||
93 | * @return string JSON-RPC version |
||
94 | */ |
||
95 | 16 | public function getVersion() |
|
99 | } |
||
100 |