Flow PHP

ExcelSniffer implements Describable, Sniffer

FinalYes

Interfaces

Describable
Sniffer

Methods

__construct()  : mixed
bytes()  : int
close()  : void
describe()  : Description|null
fromDescription()  : static
header()  : GridHeader
Memoised: after a sniff the sampled sheets may be closed, and asking again would reopen one.
names()  : array<string|int, mixed>
parts()  : array<string|int, mixed>
sniff()  : Sample
A bounded sample keeps what it parsed for take(); an unbounded one parses every row, so it streams and closes as it goes. Either way the fold stops advancing a sheet once its budget is spent.
take()  : WorkbookSheet|null
The sheet this sampler read $file through, handed over to the caller to read on and close; null when the sample never reached the file.
units()  : int

Methods

__construct()

public __construct(WorkbookReader $workbook, array<int, SourceFile> $files, InferredTypes $candidates[, null|GridHeader $header = null ]) : mixed
Parameters
$workbook : WorkbookReader
$files : array<int, SourceFile>

materialised, not a Generator: header() and sniff() both index it

$candidates : InferredTypes
$header : null|GridHeader = null

the header already resolved by the parent sniffer; a one-unit sniffer never looks for it again

bytes()

public bytes(int $unit) : int
Parameters
$unit : int
Return values
int

describe()

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

fromDescription()

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

header()

Memoised: after a sniff the sampled sheets may be closed, and asking again would reopen one.

public header() : GridHeader
Return values
GridHeader

names()

public names() : array<string|int, mixed>
Return values
array<string|int, mixed>

parts()

public parts(int $unit, int $targetBytes) : array<string|int, mixed>
Parameters
$unit : int
$targetBytes : int
Return values
array<string|int, mixed>

sniff()

A bounded sample keeps what it parsed for take(); an unbounded one parses every row, so it streams and closes as it goes. Either way the fold stops advancing a sheet once its budget is spent.

public sniff(int $unit, int|null $rowBudget) : Sample
Parameters
$unit : int
$rowBudget : int|null
Return values
Sample

take()

The sheet this sampler read $file through, handed over to the caller to read on and close; null when the sample never reached the file.

public take(SourceFile $file) : WorkbookSheet|null
Parameters
$file : SourceFile
Return values
WorkbookSheet|null
On this page

Search results