/**
* @return Type<array<mixed>>
*/
type_array() : Type
DSL References
DSL stands for Domain Specific Language. In the case of Flow, the DSL is used to define simple functions that can be used to transform data. Most of those functions are initializing a new instance of a class under the hood since Flow is fully object-oriented. Please look at the examples below to get a better understanding of how to use the DSL functions.
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
/**
* @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<string>
*/
type_json() : Type
/**
* @template T
*
* @param Type<T> $element
*
* @return ListType<T>
*/
type_list(Type $element) : ListType
/**
* @template T of bool|float|int|string
*
* @param T $value
*
* @return LiteralType<T>
*/
type_literal(string|int|float|bool $value) : LiteralType
/**
* @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
/**
* @template T
*
* @param array<string, Type<T>> $elements
* @param array<string, Type<T>> $optional_elements
*
* @return Type<array<string, T>>
*/
type_structure(array $elements, array $optional_elements, bool $allow_extra) : Type
/**
* @return Type<\DateInterval>
*/
type_time() : Type
/**
* @template T
* @template T
* @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