Flow PHP

SchemaInference

Read onlyYes
FinalYes

Properties

$filesToSniff  : int|null
$sampleSize  : int|null
$sniffs  : Sniffs|null
$types  : InferredTypes|null
$unionByName  : bool

Methods

__construct()  : mixed
candidates()  : InferredTypes
everyRow()  : self
everySource()  : self
fromArray()  : self
normalize()  : array{sample_size: null|int, files_to_sniff: null|int, types: null|list>, union_by_name: bool}

Properties

Methods

__construct()

public __construct([null|int<1, max> $sampleSize = 20480 ][, null|int<1, max> $filesToSniff = 10 ][, null|InferredTypes $types = null ][, bool $unionByName = false ][, null|Sniffs $sniffs = null ]) : mixed
Parameters
$sampleSize : null|int<1, max> = 20480
  • rows observed across every sampled source before the schema is frozen; null observes every row, see everyRow()
$filesToSniff : null|int<1, max> = 10
  • sources that yielded a row, counted while the row budget is not spent; null sniffs every source, see everySource()
$types : null|InferredTypes = null
  • the types inference may produce; null is every type but markup
$unionByName : bool = false
  • false takes the column set from the first source and treats a later source's unseen column as a divergence; true unions the sets and runs no divergence check
$sniffs : null|Sniffs = null
  • runs the whole-unit sniffs of everyRow(); null sniffs in this process; a live collaborator, never normalized
Tags
throws
InvalidArgumentException

when $sampleSize or $filesToSniff is below 1

fromArray()

public static fromArray(array<string|int, mixed> $data) : self
Parameters
$data : array<string|int, mixed>

the shape of normalize()

Return values
self

normalize()

public normalize() : array{sample_size: null|int, files_to_sniff: null|int, types: null|list>, union_by_name: bool}
Return values
array{sample_size: null|int, files_to_sniff: null|int, types: null|list>, union_by_name: bool}
On this page

Search results