class Yaml extends Yaml (View source)

Provides a YAML serialization implementation.

Allow settings to override the YAML implementation resolution.

Properties

static protected SerializationInterface $serializer

The YAML implementation to use.

from  Yaml

Methods

static string
encode(mixed $data)

Encodes data into the serialization format.

from  Yaml
static mixed
decode(string $raw)

Decodes data from the serialization format.

from  Yaml
static string
getFileExtension()

Gets the file extension for this serialization format.

from  Yaml
static 
getSerializer()

Determines which implementation to use for parsing YAML.

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.

static protected getSerializer()

Determines which implementation to use for parsing YAML.