Total Complexity | 3 |
Total Lines | 84 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 0 |
1 | <?php |
||
7 | class ShapeNormalizer |
||
8 | { |
||
9 | /** |
||
10 | * @return array |
||
11 | */ |
||
12 | 1 | public function getRequestShapeDefinition() |
|
13 | { |
||
14 | return [ |
||
15 | 1 | 'type' => 'object', |
|
16 | 'required' => [ |
||
17 | 'jsonrpc', |
||
18 | 'method' |
||
19 | ], |
||
20 | 'properties' => [ |
||
21 | 'id' => [ |
||
22 | 'example' => 'req_id', |
||
23 | 'oneOf' => [ |
||
24 | ['type' => 'string'], |
||
25 | ['type' => 'number'], |
||
26 | ], |
||
27 | ], |
||
28 | 'jsonrpc' => [ |
||
29 | 'type' => 'string', |
||
30 | 'example' => '2.0', |
||
31 | ], |
||
32 | 'method' => [ |
||
33 | 'type' => 'string', |
||
34 | ], |
||
35 | 'params' => [ |
||
36 | 'title' => 'Method parameters', |
||
37 | ], |
||
38 | ], |
||
39 | ]; |
||
40 | } |
||
41 | |||
42 | /** |
||
43 | * @return array |
||
44 | */ |
||
45 | 1 | public function getResponseShapeDefinition() |
|
69 | ], |
||
70 | ], |
||
71 | ]; |
||
72 | } |
||
73 | |||
74 | /** |
||
75 | * @return array |
||
76 | */ |
||
77 | 1 | public function getErrorShapeDefinition() |
|
91 | ], |
||
92 | ] |
||
96 |