Documentation

RFC4180Field extends php_user_filter
in package

A stream filter to conform the CSV field to RFC4180.

since version 9.2.0

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

Tags
see
AbstractCsv::setEscape
see
https://tools.ietf.org/html/rfc4180#section-2

Table of Contents

Constants

FILTERNAME  = 'convert.league.csv.rfc4180'

Properties

$force_enclosure  : string
Characters that triggers enclosure with PHP fputcsv.
$replace  : array<string|int, string>
The replacement value that replace found $search values.
$search  : array<string|int, string>
The value being search for.

Methods

addFormatterTo()  : Writer
Add a formatter to the {@link Writer} object to format the record field to avoid enclosure around a field with an empty space.
addTo()  : AbstractCsv
Static method to add the stream filter to a {@link AbstractCsv} 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.
isValidParams()  : bool
isValidSequence()  : bool
Is Valid White space replaced sequence.

Constants

FILTERNAME

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

Properties

$force_enclosure

Characters that triggers enclosure with PHP fputcsv.

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

$replace

The replacement value that replace found $search values.

protected array<string|int, string> $replace = []

The value being search for.

protected array<string|int, string> $search = []

Methods

addFormatterTo()

Add a formatter to the {@link Writer} object to format the record field to avoid enclosure around a field with an empty space.

public static addFormatterTo(Writer $csv, string $whitespace_replace) : Writer

use League\Csv\Reader::setEscape or League\Csv\Writer::setEscape instead

Parameters
$csv : Writer
$whitespace_replace : string
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\Reader::setEscape or League\Csv\Writer::setEscape instead

Return values
bool

register()

Static method to register the class as a stream filter.

public static register() : void

isValidParams()

protected isValidParams(array<string|int, mixed> $params) : bool
Parameters
$params : array<string|int, mixed>
Tags
codeCoverageIgnore

Validate params property.

Return values
bool

isValidSequence()

Is Valid White space replaced sequence.

protected isValidSequence(array<string|int, mixed> $params) : bool
Parameters
$params : array<string|int, mixed>
Return values
bool

        
On this page

Search results