| Total Complexity | 6 |
| Total Lines | 46 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 0 | ||
| 1 | <?php |
||
| 16 | class RequestObject implements RequestObjectInterface, \JsonSerializable |
||
| 17 | { |
||
| 18 | private string $jsonrpc = '2.0'; |
||
| 19 | |||
| 20 | private string $method; |
||
| 21 | |||
| 22 | /** @var mixed */ |
||
| 23 | private $params; |
||
| 24 | |||
| 25 | /** @var string|int */ |
||
| 26 | private $id; |
||
| 27 | |||
| 28 | public function __construct($id, string $method, $params) |
||
| 29 | { |
||
| 30 | 51 | $this->id = $id; |
|
| 31 | $this->method = $method; |
||
| 32 | 51 | $this->params = $params; |
|
| 33 | 51 | } |
|
| 34 | 51 | ||
| 35 | 51 | public function getId() |
|
| 38 | } |
||
| 39 | 13 | ||
| 40 | public function getProtocol(): string |
||
| 43 | } |
||
| 44 | 2 | ||
| 45 | public function getMethod(): string |
||
| 46 | { |
||
| 47 | 8 | return $this->method; |
|
| 48 | } |
||
| 49 | 8 | ||
| 50 | public function getParams() |
||
| 51 | { |
||
| 52 | 2 | return $this->params; |
|
| 53 | } |
||
| 54 | 2 | ||
| 55 | public function jsonSerialize(): array |
||
| 62 | 42 | ]; |
|
| 63 | 42 | } |
|
| 64 | } |
||
| 65 |