class Base64Serializer implements SerializerInterface (View source)

Encodes and decodes data to and from base64.

Throws a Base64Exception when decoding an invalid base64 string while strict is true.

Methods

__construct(bool $strict = true)

No description

mixed
decode(mixed $value)

Deserialize the value.

mixed
encode(mixed $value)

Serialize the value.

make(bool $strict = true)

No description

Details

__construct(bool $strict = true)

No description

Parameters

bool $strict

Whether to throw an exception when decoding an invalid base64 string (default: true).

mixed decode(mixed $value)

Deserialize the value.

Parameters

mixed $value

The value to decode.

Return Value

mixed

mixed encode(mixed $value)

Serialize the value.

Parameters

mixed $value

The value to encode.

Return Value

mixed

static Base64Serializer make(bool $strict = true)

No description

Parameters

bool $strict

Whether to throw an exception when decoding an invalid base64 string (default: true).

Return Value

Base64Serializer