@@ -30,23 +30,23 @@ |
||
| 30 | 30 | |
| 31 | 31 | // This is the minimal schema that all incoming payloads must |
| 32 | 32 | // conform to in order to be considered well-formed JSON-RPC requests. |
| 33 | - self::$schema = (object)[ |
|
| 33 | + self::$schema = (object) [ |
|
| 34 | 34 | '$schema' => 'https://json-schema.org/draft-07/schema#', |
| 35 | 35 | 'description' => 'JSON-RPC 2.0 single request schema', |
| 36 | 36 | 'type' => 'object', |
| 37 | 37 | 'required' => ['jsonrpc', 'method'], |
| 38 | 38 | 'additionalProperties' => false, |
| 39 | - 'properties' => (object)[ |
|
| 40 | - 'jsonrpc' => (object)[ |
|
| 39 | + 'properties' => (object) [ |
|
| 40 | + 'jsonrpc' => (object) [ |
|
| 41 | 41 | 'enum' => ['2.0'], |
| 42 | 42 | ], |
| 43 | - 'method' => (object)[ |
|
| 43 | + 'method' => (object) [ |
|
| 44 | 44 | 'type' => 'string', |
| 45 | 45 | ], |
| 46 | - 'params' => (object)[ |
|
| 46 | + 'params' => (object) [ |
|
| 47 | 47 | 'type' => ['array', 'object'], |
| 48 | 48 | ], |
| 49 | - 'id' => (object)[ |
|
| 49 | + 'id' => (object) [ |
|
| 50 | 50 | 'type' => ['integer', 'string'], |
| 51 | 51 | ], |
| 52 | 52 | ], |
@@ -175,7 +175,7 @@ |
||
| 175 | 175 | { |
| 176 | 176 | try { |
| 177 | 177 | return $this->container->get(OpisValidator::class)->validate($data, $schema); |
| 178 | - } catch (NotFoundExceptionInterface|ContainerExceptionInterface) { |
|
| 178 | + } catch (NotFoundExceptionInterface | ContainerExceptionInterface) { |
|
| 179 | 179 | return (new OpisValidator())->validate($data, $schema); |
| 180 | 180 | } |
| 181 | 181 | } |
@@ -8,7 +8,7 @@ |
||
| 8 | 8 | { |
| 9 | 9 | private mixed $result; |
| 10 | 10 | |
| 11 | - public function __construct(int|string|null $id, mixed $result = null) |
|
| 11 | + public function __construct(int | string | null $id, mixed $result = null) |
|
| 12 | 12 | { |
| 13 | 13 | $this->id = $id; |
| 14 | 14 | $this->result = $result; |
@@ -6,5 +6,5 @@ |
||
| 6 | 6 | |
| 7 | 7 | abstract class Response implements \JsonSerializable |
| 8 | 8 | { |
| 9 | - protected int|string|null $id; |
|
| 9 | + protected int | string | null $id; |
|
| 10 | 10 | } |
@@ -6,11 +6,11 @@ |
||
| 6 | 6 | |
| 7 | 7 | final class Error extends Response |
| 8 | 8 | { |
| 9 | - private int|string|null $code; |
|
| 9 | + private int | string | null $code; |
|
| 10 | 10 | private string $message; |
| 11 | 11 | private mixed $data; |
| 12 | 12 | |
| 13 | - public function __construct(int $code, string $message, mixed $data = null, int|string|null $id = null) |
|
| 13 | + public function __construct(int $code, string $message, mixed $data = null, int | string | null $id = null) |
|
| 14 | 14 | { |
| 15 | 15 | $this->code = $code; |
| 16 | 16 | $this->message = $message; |
@@ -11,9 +11,9 @@ discard block |
||
| 11 | 11 | final class Request implements \JsonSerializable |
| 12 | 12 | { |
| 13 | 13 | private mixed $raw; |
| 14 | - private int|string|null $id; |
|
| 14 | + private int | string | null $id; |
|
| 15 | 15 | private string $method; |
| 16 | - private stdClass|array|null $params; |
|
| 16 | + private stdClass | array | null $params; |
|
| 17 | 17 | |
| 18 | 18 | public function __construct(Input $input) |
| 19 | 19 | { |
@@ -26,7 +26,7 @@ discard block |
||
| 26 | 26 | $this->params = $this->raw->params ?? null; |
| 27 | 27 | } |
| 28 | 28 | |
| 29 | - public function id(): int|string|null |
|
| 29 | + public function id(): int | string | null |
|
| 30 | 30 | { |
| 31 | 31 | return $this->id; |
| 32 | 32 | } |
@@ -36,7 +36,7 @@ discard block |
||
| 36 | 36 | return $this->method; |
| 37 | 37 | } |
| 38 | 38 | |
| 39 | - public function params(): stdClass|array|null |
|
| 39 | + public function params(): stdClass | array | null |
|
| 40 | 40 | { |
| 41 | 41 | return $this->params; |
| 42 | 42 | } |