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.
TYPE
/**
* @return Type<array<mixed>>
*/
type_array() : Type /**
* @return Type<bool>
*/
type_boolean() : Type /**
* @return Type<callable>
*/
type_callable() : Type /**
* @template T of object
*
* @param null|class-string<T> $class
*
* @return ($class is null ? Type<class-string> : Type<class-string<T>>)
*/
type_class_string(?string $class) : Type /**
* @return Type<\DateTimeInterface>
*/
type_date() : Type /**
* @return Type<\DateTimeInterface>
*/
type_datetime() : Type /**
* @template T of UnitEnum
*
* @param class-string<T> $class
*
* @return Type<T>
*/
type_enum(string $class) : Type /**
* @return Type<float>
*/
type_float() : Type /**
* @return Type<HTMLDocument>
*/
type_html() : Type /**
* @return Type<HTMLElement>
*/
type_html_element() : Type /**
* @template T of object
*
* @param class-string<T> $class
*
* @return Type<T>
*/
type_instance_of(string $class) : Type /**
* @return Type<int>
*/
type_integer() : Type /**
* @template T
*
* @param Type<T> $first
* @param Type<T> $second
* @param Type<T> ...$types
*
* @return Type<T>
*/
type_intersection(Type $first, Type $second, Type $types) : Type /**
* @return Type<Json>
*/
type_json() : Type /**
* @template T
*
* @param Type<T> $element
*
* @return Type<list<T>>
*/
type_list(Type $element) : Type /**
* @template T of bool|float|int|string
*
* @param T $value
*
* @return Type<T>
*/
type_literal(string|int|float|bool $value) : Type /**
* @template TKey of array-key
* @template TValue
*
* @param Type<TKey> $key_type
* @param Type<TValue> $value_type
*
* @return Type<array<TKey, TValue>>
*/
type_map(Type $key_type, Type $value_type) : Type /**
* @return Type<mixed>
*/
type_mixed() : Type /**
* @return Type<non-empty-string>
*/
type_non_empty_string() : Type /**
* @return Type<null>
*/
type_null() : Type /**
* @return Type<numeric-string>
*/
type_numeric_string() : Type /**
* @return Type<object>
*/
type_object() : Type /**
* @template T
*
* @param Type<T> $type
*
* @return Type<T>
*/
type_optional(Type $type) : Type /**
* @return Type<int<0, max>>
*/
type_positive_integer() : Type /**
* @return Type<resource>
*/
type_resource() : Type /**
* @return Type<bool|float|int|string>
*/
type_scalar() : Type /**
* @return Type<string>
*/
type_string() : Type /**
* @param array<string, Type<mixed>> $elements
* @param array<string, Type<mixed>> $optional_elements
*
* @return Type<array<string, mixed>>
*/
type_structure(array $elements, array $optional_elements, bool $allow_extra) : Type /**
* @return Type<\DateInterval>
*/
type_time() : Type /**
* @return Type<\DateTimeZone>
*/
type_time_zone() : Type /**
* @template T
*
* @param Type<T> $first
* @param Type<T> $second
* @param Type<T> ...$types
*
* @return Type<T>
*/
type_union(Type $first, Type $second, Type $types) : Type /**
* @return Type<Uuid>
*/
type_uuid() : Type /**
* @return Type<\DOMDocument>
*/
type_xml() : Type /**
* @return Type<\DOMElement>
*/
type_xml_element() : Type HELPER
dom_element_to_string(DOMElement $element, bool $format_output, bool $preserver_white_space) : string|false /**
* @return Type<mixed>
*/
get_type(?mixed $value) : Type /**
* @template T
*
* @param Type<T> ...$types
*
* @return Types<T>
*/
types(Type $types) : Types /**
* @param Type<mixed> $left
* @param Type<mixed> $right
*/
type_equals(Type $left, Type $right) : bool /**
* @param array<string, mixed> $data
*
* @return Type<mixed>
*/
type_from_array(array $data) : Type /**
* @template T
*
* @param Type<T> $type
* @param class-string<Type<mixed>> $typeClass
*/
type_is(Type $type, string $typeClass) : bool /**
* @template T
*
* @param Type<T> $type
* @param class-string<Type<mixed>> $typeClass
* @param class-string<Type<mixed>> ...$typeClasses
*/
type_is_any(Type $type, string $typeClass, string $typeClasses) : bool /**
* @template T
*
* @param Type<T> $type
*/
type_is_nullable(Type $type) : bool