Flow PHP

functions.php

Functions

from_json()

from_json(Path|string $path[, string|null $pointer = null ][, null|Schema $schema = null ]) : JsonExtractor
Parameters
$path : Path|string
  • string is internally turned into stream
$pointer : string|null = null
  • if you want to iterate only results of a subtree, use a pointer, read more at https://github.com/halaxa/json-machine#parsing-a-subtree - @deprecate use withPointer method instead
$schema : null|Schema = null
  • enforce schema on the extracted data - @deprecate use withSchema method instead
Return values
JsonExtractor

from_json_lines()

Used to read from a JSON lines https://jsonlines.org/ formatted file.

from_json_lines(Path|string $path) : JsonLinesExtractor
Parameters
$path : Path|string
  • string is internally turned into stream
Return values
JsonLinesExtractor

to_json()

to_json(Path|string $path[, int $flags = JSON_THROW_ON_ERROR ][, string $date_time_format = DateTimeInterface::ATOM ][, bool $put_rows_in_new_lines = false ]) : JsonLoader
Parameters
$path : Path|string
$flags : int = JSON_THROW_ON_ERROR
  • PHP JSON Flags - @deprecate use withFlags method instead
$date_time_format : string = DateTimeInterface::ATOM
  • format for DateTimeInterface::format() - @deprecate use withDateTimeFormat method instead
$put_rows_in_new_lines : bool = false
  • if you want to put each row in a new line - @deprecate use withRowsInNewLines method instead
Return values
JsonLoader

to_json_lines()

Used to write to a JSON lines https://jsonlines.org/ formatted file.

to_json_lines(Path|string $path) : JsonLinesLoader
Parameters
$path : Path|string
Return values
JsonLinesLoader

schema_from_json_schema()

Convert a JSON Schema (https://json-schema.org) document into a Flow Schema.

schema_from_json_schema(array<string, mixed>|Path|string $json_schema[, null|ClientInterface $client = null ][, null|RequestFactoryInterface $request_factory = null ]) : Schema
Parameters
$json_schema : array<string, mixed>|Path|string
  • decoded document, raw JSON document or a path to a schema file
$client : null|ClientInterface = null
  • PSR-18 http client, required to resolve remote http(s) references
$request_factory : null|RequestFactoryInterface = null
  • PSR-17 request factory, required to resolve remote http(s) references
Return values
Schema

schema_to_json_schema()

Convert a Flow Schema into a JSON Schema (https://json-schema.org, draft 2020-12) document.

schema_to_json_schema(Schema $schema) : array<string, mixed>
Parameters
$schema : Schema
Return values
array<string, mixed>
On this page

Search results