eloquent/endec API
Interface

Eloquent\Endec\CodecInterface

interface CodecInterface implements EncoderInterface, DecoderInterface

The interface implemented by codecs.

Methods

string encode(string $data)

Encode the supplied data.

from EncoderInterface
TransformStreamInterface createEncodeStream(integer|null $bufferSize = null)

Create a new encode stream.

from EncoderInterface
string decode(string $data)

Decode the supplied data.

from DecoderInterface
TransformStreamInterface createDecodeStream(integer|null $bufferSize = null)

Create a new decode stream.

from DecoderInterface

Details

in EncoderInterface at line 29
public string encode(string $data)

Encode the supplied data.

Parameters

string $data The data to encode.

Return Value

string The encoded data.

Exceptions

EncodingExceptionInterface If the data cannot be encoded.

in EncoderInterface at line 38
public TransformStreamInterface createEncodeStream(integer|null $bufferSize = null)

Create a new encode stream.

Parameters

integer|null $bufferSize The buffer size in bytes.

Return Value

TransformStreamInterface The newly created encode stream.

in DecoderInterface at line 29
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.

in DecoderInterface at line 38
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.