class WriterFactory (View source)

Get an instance of a CSV Writer.

Properties

protected EscapeFormula $formatter
protected string $writerClass

Methods

__construct(EscapeFormula $formatter, string $writerClass = Writer::class)

No description

Writer
createFromString(string $string)

Create a CSV writer from a string.

Writer
createFromFileObject(SplFileObject $fileObject)

Create a CSV writer from a file object.

Writer
createFromStream(resource $stream)

Create a CSV writer from a stream.

Writer
createFromPath(string $path, string $open_mode = 'r+')

Create a CSV writer from a string.

Writer
prepare(Writer $writer)

Add extra details to a writer.

Details

__construct(EscapeFormula $formatter, string $writerClass = Writer::class)

No description

Parameters

EscapeFormula $formatter
string $writerClass

Writer createFromString(string $string)

Create a CSV writer from a string.

Parameters

string $string

Return Value

Writer

See also

\League\Csv\AbstractCsv::createFromString()

Writer createFromFileObject(SplFileObject $fileObject)

Create a CSV writer from a file object.

Parameters

SplFileObject $fileObject

Return Value

Writer

See also

\League\Csv\AbstractCsv::createFromFileObject()

Writer createFromStream(resource $stream)

Create a CSV writer from a stream.

Parameters

resource $stream

Return Value

Writer

See also

\League\Csv\AbstractCsv::createFromStream()

Writer createFromPath(string $path, string $open_mode = 'r+')

Create a CSV writer from a string.

Parameters

string $path
string $open_mode

Return Value

Writer

See also

\League\Csv\AbstractCsv::createFromPath()

protected Writer prepare(Writer $writer)

Add extra details to a writer.

Parameters

Writer $writer

Return Value

Writer