1 | <?php |
||
9 | class RequestBuilder |
||
10 | { |
||
11 | const JSON_SCHEMA_PATH = '/../../jsonschemas/request.json'; |
||
12 | |||
13 | /** |
||
14 | * @var mixed should be object or array |
||
15 | */ |
||
16 | protected $decodedJson; |
||
17 | |||
18 | /** |
||
19 | * @param string $jsonRpcMessage |
||
20 | * |
||
21 | * @throws InvalidRequest |
||
22 | * @throws ParseError |
||
23 | */ |
||
24 | 33 | public function __construct($jsonRpcMessage) |
|
37 | |||
38 | /** |
||
39 | * @return bool |
||
40 | */ |
||
41 | 30 | public function isBatchRequest() |
|
45 | |||
46 | /** |
||
47 | * @return mixed should be object or array |
||
48 | */ |
||
49 | 30 | public function decodedJson() |
|
53 | |||
54 | /** |
||
55 | * @param object $jsonObject |
||
56 | * |
||
57 | * @return AbstractRequest NotificationRequest|Request |
||
58 | * |
||
59 | * @throws InvalidRequest |
||
60 | */ |
||
61 | 27 | public function buildRequest($jsonObject) |
|
75 | |||
76 | /** |
||
77 | * @param mixed $jsonDecodedMessage |
||
78 | * |
||
79 | * @return JsonSchemaValidator |
||
80 | */ |
||
81 | 27 | protected function assembleJsonSchemaValidator($jsonDecodedMessage) |
|
89 | |||
90 | /** |
||
91 | * @param int $jsonLastError |
||
92 | * |
||
93 | * @return string |
||
94 | */ |
||
95 | 3 | protected function buildJsonErrorMessage($jsonLastError) |
|
122 | } |
||
123 |