class Json

Properties

static protected null|callable $encoder

The custom JSON encoder.

static protected null|callable $decoder

The custom JSON decoder.

Methods

static mixed
encode(mixed $value, int $flags = 0)

Encode the given value.

static mixed
decode(mixed $value, bool|null $associative = true)

Decode the given value.

static void
encodeUsing(callable|null $encoder)

Encode all values using the given callable.

static void
decodeUsing(callable|null $decoder)

Decode all values using the given callable.

static void
flushState()

Flush all static state.

Details

at line 26
static mixed encode(mixed $value, int $flags = 0)

Encode the given value.

Parameters

mixed $value
int $flags

Return Value

mixed

at line 36
static mixed decode(mixed $value, bool|null $associative = true)

Decode the given value.

Parameters

mixed $value
bool|null $associative

Return Value

mixed

at line 49
static void encodeUsing(callable|null $encoder)

Encode all values using the given callable.

Boot-only. The encoder persists in a static property for the worker lifetime and affects every subsequent JSON cast encode.

Parameters

callable|null $encoder

Return Value

void

at line 60
static void decodeUsing(callable|null $decoder)

Decode all values using the given callable.

Boot-only. The decoder persists in a static property for the worker lifetime and affects every subsequent JSON cast decode.

Parameters

callable|null $decoder

Return Value

void

at line 68
static void flushState()

Flush all static state.

Return Value

void