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
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
= []
$search
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
WriteraddTo()
Static method to add the stream filter to a {@link AbstractCsv} object.
public
static addTo(AbstractCsv $csv[, string $whitespace_replace = '' ]) : AbstractCsv
Parameters
- $csv : AbstractCsv
- $whitespace_replace : string = ''
Return values
AbstractCsvfilter()
public
filter(resource $in, resource $out, int &$consumed, bool $closing) : int
Parameters
- $in : resource
- $out : resource
- $consumed : int
- $closing : bool
Return values
intgetFiltername()
Static method to return the stream filter filtername.
public
static getFiltername() : string
Return values
stringonCreate()
public
onCreate() : bool
use League\Csv\Reader::setEscape or League\Csv\Writer::setEscape instead
Return values
boolregister()
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
Return values
boolisValidSequence()
Is Valid White space replaced sequence.
protected
isValidSequence(array<string|int, mixed> $params) : bool
Parameters
- $params : array<string|int, mixed>