Json
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.
at line 36
static mixed
decode(mixed $value, bool|null $associative = true)
Decode the given value.
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.
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.
at line 68
static void
flushState()
Flush all static state.