Flow PHP

ColumnTypes

FinalYes

Methods

__construct()  : mixed
folded()  : SniffedColumns
The fold so far, closed: what crosses a process boundary and what the inferrer merges.
fromColumnTypes()  : self
A fold computed elsewhere (a native reader, a subprocess) - equal to the observe() fold over the same rows.
observe()  : void
rows()  : int
sniff()  : self

Methods

__construct()

public __construct(array<int, string> $names, TypeNarrower $typer[, TypeWidener $widener = new TypeWidener() ]) : mixed
Parameters
$names : array<int, string>
  • columns known before any row - a header; [] for a headerless source
$typer : TypeNarrower
$widener : TypeWidener = new TypeWidener()

fromColumnTypes()

A fold computed elsewhere (a native reader, a subprocess) - equal to the observe() fold over the same rows.

public static fromColumnTypes(array<string|int, Type<string|int, mixed>> $types, int $rows, TypeNarrower $typer[, TypeWidener $widener = new TypeWidener() ]) : self
Parameters
$types : array<string|int, Type<string|int, mixed>>
  • first-seen order, header names first
$rows : int
$typer : TypeNarrower
$widener : TypeWidener = new TypeWidener()
Return values
self

observe()

public observe(array<string|int, mixed> $row) : void
Parameters
$row : array<string|int, mixed>

sniff()

public static sniff(array<int, string> $names, iterable<int, array<string|int, mixed>> $rows, null|int<0, max> $rowBudget, TypeNarrower $typer) : self
Parameters
$names : array<int, string>
  • columns known before any row; [] when the format carries none (JSON)
$rows : iterable<int, array<string|int, mixed>>
  • one unit's rows, unstarted
$rowBudget : null|int<0, max>
  • rows to observe, 0 for none, null for every row
$typer : TypeNarrower
Return values
self
On this page

Search results