class Json implements SerializationInterface (View source)

Default serialization for JSON.

Methods

static string
encode($variable)

Encodes data into the serialization format.

static mixed
decode($string)

Decodes data from the serialization format.

static string
getFileExtension()

Gets the file extension for this serialization format.

Details

static string encode($variable)

Encodes data into the serialization format.

Parameters

$variable

Return Value

string

The encoded data.

Exceptions

InvalidDataTypeException

static mixed decode($string)

Decodes data from the serialization format.

Parameters

$string

Return Value

mixed

The decoded data.

Exceptions

InvalidDataTypeException

static string getFileExtension()

Gets the file extension for this serialization format.

Return Value

string

The file extension, without leading dot.