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