Encoder
Less than 1 minute
Encoder
interface EncoderMethods
getContentType
Returns the content type associated with the encoder.
public getContentType(): stringReturns: string
request
Creates a request string for the specified method and parameters.
public request(string $method, array $params, null|int|string $requestID): mixedReturns: mixed
Parameters
| Parameter | Type | Description |
|---|---|---|
$method | string | |
$params | array | |
$requestID | null | int |
response
Generates a response for an RPC request.
public response(mixed $result, null|int|string $requestID): mixedReturns: mixed
Parameters
| Parameter | Type | Description |
|---|---|---|
$result | mixed | |
$requestID | null | int |
parse
Parses a response string and returns the result.
public parse(string $message, ?string $method, null|int|string $requestID): mixedReturns: mixed
Parameters
| Parameter | Type | Description |
|---|---|---|
$message | string | |
$method | string | |
$requestID | null | int |
error
Returns an array representing the error details.
public error(\Throwable $error, null|int|string $id): mixedReturns: mixed
Parameters
| Parameter | Type | Description |
|---|---|---|
$error | Throwable | |
$id | null | int |
encodeResponse
Encodes the given response data into a format suitable for RPC transmission.
public encodeResponse(mixed $response): ResponseReturns: Hazaar\Controller\Response
Parameters
| Parameter | Type | Description |
|---|---|---|
$response | mixed |
Generated by Hazaar API Doc Generator on Fri, 04 Sep 2026 23:32:17 +0000