DSL References
DSL stands for Domain Specific Language. In Flow, the DSL is a set of small functions that wrap object construction so pipelines read top-to-bottom. See the examples for usage in context.
EXTRACTOR
/**
* @param Path|string $path - string is internally turned into stream
* @param ?string $pointer - 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
* @param null|Schema $schema - enforce schema on the extracted data - @deprecate use withSchema method instead
*/
from_json(Path|string $path, ?string $pointer, ?Schema $schema) : JsonExtractor /**
* Used to read from a JSON lines https://jsonlines.org/ formatted file.
*
* @param Path|string $path - string is internally turned into stream
*/
from_json_lines(Path|string $path) : JsonLinesExtractor HELPER
/**
* Convert a JSON Schema (https://json-schema.org) document into a Flow Schema.
*
* @param array<string, mixed>|Path|string $json_schema - decoded document, raw JSON document or a path to a schema file
* @param null|ClientInterface $client - PSR-18 http client, required to resolve remote http(s) references
* @param null|RequestFactoryInterface $request_factory - PSR-17 request factory, required to resolve remote http(s) references
*/
schema_from_json_schema(Path|array|string $json_schema, ?ClientInterface $client, ?RequestFactoryInterface $request_factory) : Schema /**
* Convert a Flow Schema into a JSON Schema (https://json-schema.org, draft 2020-12) document.
*
* @return array<string, mixed>
*/
schema_to_json_schema(Schema $schema) : array LOADER
/**
* @param Path|string $path
* @param int $flags - PHP JSON Flags - @deprecate use withFlags method instead
* @param string $date_time_format - format for DateTimeInterface::format() - @deprecate use withDateTimeFormat method instead
* @param bool $put_rows_in_new_lines - if you want to put each row in a new line - @deprecate use withRowsInNewLines method instead
*
* @return JsonLoader
*/
to_json(Path|string $path, int $flags, string $date_time_format, bool $put_rows_in_new_lines) : JsonLoader /**
* Used to write to a JSON lines https://jsonlines.org/ formatted file.
*
* @param Path|string $path
*
* @return JsonLinesLoader
*/
to_json_lines(Path|string $path) : JsonLinesLoader