class YamlSymfony implements SerializationInterface (View source)

Default serialization for YAML using the Symfony component.

Methods

static string
encode(mixed $data)

Encodes data into the serialization format.

static mixed
decode(string $raw)

Decodes data from the serialization format.

static string
getFileExtension()

Gets the file extension for this serialization format.

Details

static string encode(mixed $data)

Encodes data into the serialization format.

Parameters

mixed $data

The data to encode.

Return Value

string

The encoded data.

Exceptions

InvalidDataTypeException

static mixed decode(string $raw)

Decodes data from the serialization format.

Parameters

string $raw

The raw data string to decode.

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.