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
/**
* @template T
*
* @param \Flow\Types\Type<T> $first
* @param Type<T> $second
* @param \Flow\Types\Type<T> ...$types
*
* @return IntersectionType<T, T>
*/
type_intersection(Type $first, Type $second, Type $types) : IntersectionType
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_mixed() : MixedType
type_non_empty_string() : NonEmptyStringType
type_null() : NullType
type_object() : ObjectType
/**
* @template T
*
* @param Type<T> $type
*
* @return OptionalType<T>
*/
type_optional(Type $type) : OptionalType
type_positive_integer() : PositiveIntegerType
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 \Flow\Types\Type<T> $first
* @param Type<T> $second
* @param \Flow\Types\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
dom_element_to_string(DOMElement $element, bool $format_output, bool $preserver_white_space) : string|false
/**
* @return Type<mixed>
*/
get_type(?mixed $value) : Type
/**
* @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 \Flow\Types\Type<mixed>
*/
type_from_array(array $data) : Type
/**
* @template T
*
* @param \Flow\Types\Type<T> $type
* @param class-string<\Flow\Types\Type<mixed>> $typeClass
*/
type_is(Type $type, string $typeClass) : bool
/**
* @template T
*
* @param \Flow\Types\Type<T> $type
* @param class-string<\Flow\Types\Type<mixed>> $typeClass
* @param class-string<\Flow\Types\Type<mixed>> ...$typeClasses
*/
type_is_any(Type $type, string $typeClass, string $typeClasses) : bool
/**
* @param Type<mixed> $type
*/
type_is_nullable(Type $type) : bool