type_array() : ArrayType
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
type_boolean() : BooleanType
type_callable() : CallableType
type_date() : DateType
type_datetime() : DateTimeType
/**
* @template T of UnitEnum
*
* @param class-string<T> $class
*
* @return EnumType<T>
*/
type_enum(string $class) : EnumType
type_float() : FloatType
/**
* @template T of object
*
* @param class-string<T> $class
*
* @return InstanceOfType<T>
*/
type_instance_of(string $class) : InstanceOfType
type_integer() : IntegerType
type_json() : JsonType
/**
* @template T
*
* @param Type<T> $element
*
* @return ListType<T>
*/
type_list(Type $element) : ListType
/**
* @template T
*
* @param Type<T> $value_type
*
* @return MapType<array-key, T>
*/
type_map(StringType|IntegerType $key_type, Type $value_type) : MapType
type_null() : NullType
type_object() : ObjectType
/**
* @template T
*
* @param Type<T> $type
*
* @return OptionalType<T>
*/
type_optional(Type $type) : OptionalType
type_resource() : ResourceType
type_scalar() : ScalarType
type_string() : StringType
/**
* @template T of array
*
* @param T $elements
*
* @return StructureType<T>
*/
type_structure(array $elements) : StructureType
type_time() : TimeType
/**
* @template T
*
* @param Type<T> $first
* @param Type<T> $second
* @param Type<T> ...$types
*
* @return UnionType<T, T>
*/
type_union(Type $first, Type $second, Type $types) : UnionType
type_uuid() : UuidType
type_xml() : XMLType
type_xml_element() : XMLElementType
HELPER
/**
* @param Type<mixed> $type
*/
is_nullable(Type $type) : bool
/**
* @param Type<mixed> ...$types
*/
types(Type $types) : Types
/**
* @template TLeft
* @template TRight
*
* @param Type<TLeft> $left
* @param Type<TRight> $right
*/
type_equals(Type $left, Type $right) : bool
/**
* @param array<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