Conditions | 2 |
Paths | 2 |
Total Lines | 45 |
Code Lines | 32 |
Lines | 0 |
Ratio | 0 % |
Tests | 40 |
CRAP Score | 2 |
Changes | 2 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
32 | 8 | public function get(stdClass $paramsSchema = null): stdClass |
|
33 | { |
||
34 | 8 | $params = [ |
|
35 | 8 | 'type' => [ |
|
36 | 8 | 'object', |
|
37 | 8 | 'array', |
|
38 | 8 | 'string', |
|
39 | 8 | 'number', |
|
40 | 8 | 'boolean', |
|
41 | 8 | 'null', |
|
42 | 8 | ], |
|
43 | 8 | ]; |
|
44 | |||
45 | 8 | if ($paramsSchema !== null) { |
|
46 | $params = $paramsSchema; |
||
47 | } |
||
48 | |||
49 | 8 | return $this->assocArrToObject( |
|
50 | 8 | [ |
|
51 | 8 | 'type' => 'object', |
|
52 | 8 | 'description' => 'json rpc 2.0 request schema', |
|
53 | 8 | 'additionalProperties' => false, |
|
54 | 8 | 'required' => [ |
|
55 | 8 | 'jsonrpc', |
|
56 | 8 | 'method', |
|
57 | 8 | ], |
|
58 | 8 | 'properties' => [ |
|
59 | 8 | 'jsonrpc' => [ |
|
60 | 8 | 'type' => 'string', |
|
61 | 8 | 'enum' => [ |
|
62 | 8 | '2.0', |
|
63 | 8 | ], |
|
64 | 8 | ], |
|
65 | 8 | 'method' => [ |
|
66 | 8 | 'type' => 'string', |
|
67 | 8 | 'examples' => [ |
|
68 | 8 | 'Foo.bar', |
|
69 | 8 | ], |
|
70 | 8 | ], |
|
71 | 8 | 'params' => $params, |
|
72 | 8 | 'id' => [ |
|
73 | 8 | 'type' => [ |
|
74 | 8 | 'string', |
|
75 | 8 | 'null', |
|
76 | 8 | 'integer', |
|
77 | 8 | ], |
|
84 |