eloquent/endec API
Class

Eloquent\Endec\Decoder

class Decoder implements DecoderInterface

A general-purpose decoder implementation for composing custom decoders.

Methods

__construct(TransformInterface $decodeTransform)

Construct a new decoder.

TransformInterface decodeTransform()

Get the decode transform.

string decode(string $data)

Decode the supplied data.

TransformStreamInterface createDecodeStream(integer|null $bufferSize = null)

Create a new decode stream.

Details

at line 28
public __construct(TransformInterface $decodeTransform)

Construct a new decoder.

Parameters

TransformInterface $decodeTransform The decode transform to use.

at line 38
public TransformInterface decodeTransform()

Get the decode transform.

Return Value

TransformInterface The decode transform.

at line 51
public string decode(string $data)

Decode the supplied data.

Parameters

string $data The data to decode.

Return Value

string The decoded data.

Exceptions

EncodingExceptionInterface If the data cannot be decoded.

at line 70
public TransformStreamInterface createDecodeStream(integer|null $bufferSize = null)

Create a new decode stream.

Parameters

integer|null $bufferSize The buffer size in bytes.

Return Value

TransformStreamInterface The newly created decode stream.