Types implements Countable, Stringable
Read onlyYes
FinalYes
Unique collection of types.
Tags
Interfaces
- Countable
- Stringable
Methods
- __construct() : mixed
- __toString() : string
- all() : array<string|int, Type<string|int, T>>
- count() : int
- deduplicate() : Types<string|int, T>
- first() : Type<string|int, T>|null
- has() : bool
- hasAll() : bool
- hasAny() : bool
- only() : Types<string|int, T>
- reduceOptionals() : Types<string|int, mixed>
- Reduce optional types to their base types.
- without() : Types<string|int, T>
Methods
__construct()
public
__construct(Type<string|int, T> ...$types) : mixed
Parameters
- $types : Type<string|int, T>
__toString()
public
__toString() : string
Return values
stringall()
public
all() : array<string|int, Type<string|int, T>>
Return values
array<string|int, Type<string|int, T>>count()
public
count() : int
Return values
intdeduplicate()
public
deduplicate() : Types<string|int, T>
Return values
Types<string|int, T>first()
public
first() : Type<string|int, T>|null
Return values
Type<string|int, T>|nullhas()
public
has(Type<string|int, mixed> $type) : bool
Parameters
- $type : Type<string|int, mixed>
Return values
boolhasAll()
public
hasAll(Type<string|int, mixed> ...$types) : bool
Parameters
- $types : Type<string|int, mixed>
Return values
boolhasAny()
public
hasAny(Type<string|int, mixed> ...$types) : bool
Parameters
- $types : Type<string|int, mixed>
Return values
boolonly()
public
only(Type<string|int, mixed> ...$types) : Types<string|int, T>
Parameters
- $types : Type<string|int, mixed>
Return values
Types<string|int, T>reduceOptionals()
Reduce optional types to their base types.
public
reduceOptionals() : Types<string|int, mixed>
Return values
Types<string|int, mixed>without()
public
without(Type<string|int, mixed> ...$types) : Types<string|int, T>
Parameters
- $types : Type<string|int, mixed>