AggregatedType
in package
implements
Type, IteratorAggregate
Base class for aggregated types like Compound and Intersection
A Aggregated Type is not so much a special keyword or object reference but is a series of Types that are separated using separator.
Tags
Interfaces, Classes and Traits
- Type
- IteratorAggregate
Table of Contents
- $token : string
- $types : array<int, Type>
- __construct() : mixed
- __toString() : string
- Returns a rendered output of the Type as it would be used in a DocBlock.
- contains() : bool
- Tests if this compound type contains the given type.
- get() : Type|null
- Returns the type at the given index.
- getIterator() : ArrayIterator<int, Type>
- has() : bool
- Tests if this compound type has a type with the given index.
- add() : void
Properties
$token
private
string
$token
$types
private
array<int, Type>
$types
= []
Tags
Methods
__construct()
public
__construct(array<string|int, Type> $types, string $token) : mixed
Parameters
- $types : array<string|int, Type>
- $token : string
Return values
mixed —__toString()
Returns a rendered output of the Type as it would be used in a DocBlock.
public
__toString() : string
Return values
string —contains()
Tests if this compound type contains the given type.
public
contains(Type $type) : bool
Parameters
- $type : Type
Return values
bool —get()
Returns the type at the given index.
public
get(int $index) : Type|null
Parameters
- $index : int
Return values
Type|null —getIterator()
public
getIterator() : ArrayIterator<int, Type>
Return values
ArrayIterator<int, Type> —has()
Tests if this compound type has a type with the given index.
public
has(int $index) : bool
Parameters
- $index : int
Return values
bool —add()
private
add(Type $type) : void
Parameters
- $type : Type