eloquent/endec API
Interface

Eloquent\Endec\EncoderInterface

interface EncoderInterface

The interface implemented by encoders.

Methods

string encode(string $data)

Encode the supplied data.

TransformStreamInterface createEncodeStream(integer|null $bufferSize = null)

Create a new encode stream.

Details

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.

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.