Documentation

EncloseField extends php_user_filter
in package

A stream filter to improve enclosure character usage.

since version 9.10.0

DEPRECATION WARNING! This class will be removed in the next major point release

Tags
see
Writer::forceEnclosure()
see
https://tools.ietf.org/html/rfc4180#section-2
see
https://bugs.php.net/bug.php?id=38301

Table of Contents

Constants

FILTERNAME  = 'convert.league.csv.enclosure'

Properties

$force_enclosure  : string
Characters that triggers enclosure in PHP.
$sequence  : string
Default sequence.

Methods

addTo()  : Writer
Static method to add the stream filter to a {@link Writer} object.
filter()  : int
getFiltername()  : string
Static method to return the stream filter filtername.
onCreate()  : bool
register()  : void
Static method to register the class as a stream filter.
isValidSequence()  : bool
Filter type and sequence parameters.

Constants

FILTERNAME

public mixed FILTERNAME = 'convert.league.csv.enclosure'

Properties

$force_enclosure

Characters that triggers enclosure in PHP.

protected static string $force_enclosure = "\n\r\t "

$sequence

Default sequence.

protected string $sequence = ''

Methods

addTo()

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

public static addTo(Writer $csv, string $sequence) : Writer
Parameters
$csv : Writer
$sequence : string
Tags
throws
InvalidArgumentException

if the sequence is malformed

throws
Exception
Return values
Writer

filter()

public filter(resource $in, resource $out, int &$consumed, bool $closing) : int
Parameters
$in : resource
$out : resource
$consumed : int
$closing : bool
Return values
int

getFiltername()

Static method to return the stream filter filtername.

public static getFiltername() : string
Return values
string

onCreate()

public onCreate() : bool

use League\Csv\Writer::forceEnclosure() instead

Return values
bool

register()

Static method to register the class as a stream filter.

public static register() : void

isValidSequence()

Filter type and sequence parameters.

protected static isValidSequence(string $sequence) : bool

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

Parameters
$sequence : string
Return values
bool

        
On this page

Search results