Types implements Countable, Stringable
Read onlyYes
FinalYes
Unique collection of types.
Interfaces
- Countable
- Stringable
Methods
- __construct() : mixed
- __toString() : string
- all() : array<string|int, Type<string|int, mixed>>
- count() : int
- deduplicate() : self
- first() : Type<string|int, mixed>|null
- has() : bool
- hasAll() : bool
- hasAny() : bool
- only() : self
- reduceOptionals() : self
- Reduce optional types to their base types.
- without() : self
Methods
__construct()
public
__construct(Type<string|int, mixed> ...$types) : mixed
Parameters
- $types : Type<string|int, mixed>
__toString()
public
__toString() : string
Return values
stringall()
public
all() : array<string|int, Type<string|int, mixed>>
Return values
array<string|int, Type<string|int, mixed>>count()
public
count() : int
Return values
intdeduplicate()
public
deduplicate() : self
Return values
selffirst()
public
first() : Type<string|int, mixed>|null
Return values
Type<string|int, mixed>|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) : self
Parameters
- $types : Type<string|int, mixed>
Return values
selfreduceOptionals()
Reduce optional types to their base types.
public
reduceOptionals() : self
Return values
selfwithout()
public
without(Type<string|int, mixed> ...$types) : self
Parameters
- $types : Type<string|int, mixed>