Flow PHP

CSVSourceOpener implements Describable

Read onlyYes
FinalYes

Interfaces

Describable

Methods

__construct()  : mixed
columns()  : array<int, string>
The column names of $stream's first record - the header, or the e00.. names; $stream stays open: the view it is read through is never closed, closing it would close $stream.
describe()  : Description|null
The extension is detected per process, never described.
dialect()  : CSVDialect
A fully declared dialect reads nothing; otherwise the undeclared parts are detected from $stream.
fromDescription()  : static
open()  : CSVOpenSource
openSplit()  : CSVOpenSource
The records whose first byte lies in the split's window. Both window ends are resynced to a record start, so a split ends exactly where its neighbour begins; only the first split reads the header and the BOM, and only the first split refuses a header diverging from $inferred - once per file.
over()  : CSVOpenSource

Methods

__construct()

public __construct(Filesystem $filesystem, CSVReadOptions $options[, CSVDialects $dialects = new CSVDialects() ][, FlowPhpExtension|null $extension = null ]) : mixed
Parameters
$filesystem : Filesystem
$options : CSVReadOptions
$dialects : CSVDialects = new CSVDialects()

the dialects known by uri; a file opened without one records the dialect it detected

$extension : FlowPhpExtension|null = null
Tags
throws
RuntimeException

flow_php is loaded but built for another version of this package

columns()

The column names of $stream's first record - the header, or the e00.. names; $stream stays open: the view it is read through is never closed, closing it would close $stream.

public columns(SourceStream $stream, CSVDialect $dialect) : array<int, string>
Parameters
$stream : SourceStream
$dialect : CSVDialect
Return values
array<int, string>

describe()

The extension is detected per process, never described.

public describe() : Description|null
Return values
Description|null

dialect()

A fully declared dialect reads nothing; otherwise the undeclared parts are detected from $stream.

public dialect(SourceStream $stream) : CSVDialect
Parameters
$stream : SourceStream
Return values
CSVDialect

fromDescription()

public static fromDescription(array<string|int, mixed> $data, Rebuild $rebuild) : static
Parameters
$data : array<string|int, mixed>
$rebuild : Rebuild
Return values
static

open()

public open(SourceFile $source[, null|InferredColumns $inferred = null ]) : CSVOpenSource
Parameters
$source : SourceFile
$inferred : null|InferredColumns = null

the columns the file must carry; checked before a row is built

Tags
throws
InferredSchemaException
Return values
CSVOpenSource

openSplit()

The records whose first byte lies in the split's window. Both window ends are resynced to a record start, so a split ends exactly where its neighbour begins; only the first split reads the header and the BOM, and only the first split refuses a header diverging from $inferred - once per file.

public openSplit(SourceFile $source, FileSplit $split[, InferredColumns|null $inferred = null ]) : CSVOpenSource
Parameters
$source : SourceFile
$split : FileSplit
$inferred : InferredColumns|null = null
Tags
throws
InferredSchemaException
Return values
CSVOpenSource

over()

public over(SourceStream $stream, CSVDialect $dialect, null|array<int, string> $headers, null|int<1, max> $charactersReadInLine) : CSVOpenSource
Parameters
$stream : SourceStream
$dialect : CSVDialect
$headers : null|array<int, string>

null reads $stream from a file's start - header and BOM as the options say; a list names the records of a window past the first one

$charactersReadInLine : null|int<1, max>
Return values
CSVOpenSource
On this page

Search results