\League\CsvEncloseField

A stream filter to improve enclosure character usage.

Summary

Methods
Properties
Constants
getFiltername()
register()
addTo()
onCreate()
filter()
$filtername
$params
FILTERNAME
isValidSequence()
$sequence
$force_enclosure
N/A
No private methods found
No private properties found
N/A

Constants

FILTERNAME

FILTERNAME = 'convert.league.csv.enclosure'

Properties

$filtername

$filtername : string

the filter name used to instantiate the class with.

Type

string

$params

$params : mixed

Contents of the params parameter passed to stream_filter_append or stream_filter_prepend functions.

Type

mixed

$sequence

$sequence : string

Default sequence.

Type

string

$force_enclosure

$force_enclosure : string

Characters that triggers enclosure in PHP.

Type

string

Methods

getFiltername()

getFiltername() 

Static method to return the stream filter filtername.

register()

register() 

Static method to register the class as a stream filter.

addTo()

addTo(\League\Csv\Writer  $csv, \League\Csv\string  $sequence) 

Static method to add the stream filter to a {@link Writer} object.

Parameters

\League\Csv\Writer $csv
\League\Csv\string $sequence

Throws

\InvalidArgumentException

if the sequence is malformed

onCreate()

onCreate() 

{@inheritdoc}

filter()

filter(  $in,   $out,   $consumed,   $closing) 

{@inheritdoc}

Parameters

$in
$out
$consumed
$closing

isValidSequence()

isValidSequence(\League\Csv\string  $sequence) 

Filter type and sequence parameters.

The sequence to force enclosure MUST contains one of the following character ("\n\r\t ")

Parameters

\League\Csv\string $sequence