Helper

Helper functions to work with PDU.

package

Default

Methods

Converts json-string to \RtmClient\Pdu\Pdu.

convertToPdu(string $json_string) : \RtmClient\Pdu\Pdu
static
Throws
\RtmClient\Exceptions\ApplicationException

if failed to parse json string

\RtmClient\Exceptions\ApplicationException

if missing "action" or "body" field in received PDU

Arguments

$json_string

string

Response

\RtmClient\Pdu\Pdu

Returns PDU code by \RtmClient\Pdu\Pdu::$action.

pduResponseCode(\RtmClient\Pdu\Pdu $pdu) : integer
static

Arguments

Response

integer

One of \RtmClient\Pdu\ReturnCode::(CODE_OK_REQUEST|CODE_ERROR_REQUEST|CODE_DATA_REQUEST|CODE_BAD_REQUEST)