Encoder
Less than 1 minute
Encoder
Methods
request
Creates a request string for the specified method and parameters.
public request(string $method, array $params, mixed $requestID): mixedParameters
| Parameter | Type | Description |
|---|---|---|
$method | string | |
$params | array | |
$requestID | mixed |
response
Generates a response for an RPC request.
public response(mixed $result, mixed $requestID): mixedParameters
| Parameter | Type | Description |
|---|---|---|
$result | mixed | |
$requestID | mixed |
parse
Parses a response string and returns the result.
public parse(string $message, ?string $method, mixed $requestID): mixedParameters
| Parameter | Type | Description |
|---|---|---|
$message | string | |
$method | string | |
$requestID | mixed |
error
Returns an array representing the error details.
public error(\Throwable $error, mixed $id): mixedParameters
| Parameter | Type | Description |
|---|---|---|
$error | \Throwable | |
$id | mixed |
encodeResponse
Encodes the given response data into a format suitable for RPC transmission.
public encodeResponse(mixed $response): ResponseParameters
| Parameter | Type | Description |
|---|---|---|
$response | mixed |
Generated by Hazaar API Doc Generator on Sun, 01 Mar 2026 09:22:26 +0000