final class Union extends Type

Methods

__construct(array $types)

No description

setTypes(array $types)

No description

array
getTypes()

No description

bool
accepts(string|self $type)

Verifies type compatibility. For example, it checks if a value of a certain type could be passed as a parameter.

bool
isAllowedBy(Type $acceptor)

Called when THIS object is the "incoming" type being checked.

bool
isSupertypeOfAtomic(Type $type)

Validates if the given atomic type matches THIS acceptor.

setNullable(bool $state = true)

Returns a type that accepts both the current type and the given type.

bool
isNullable()

No description

void
__clone()

No description

Details

at line 24
__construct(array $types)

No description

Parameters

array $types

at line 31
Union setTypes(array $types)

No description

Parameters

array $types

Return Value

Union

at line 50
array getTypes()

No description

Return Value

array

at line 56
bool accepts(string|self $type)

Verifies type compatibility. For example, it checks if a value of a certain type could be passed as a parameter.

Parameters

string|self $type

Return Value

bool

at line 65
protected bool isAllowedBy(Type $acceptor)

Called when THIS object is the "incoming" type being checked.

Parameters

Type $acceptor

Return Value

bool

at line 71
protected bool isSupertypeOfAtomic(Type $type)

Validates if the given atomic type matches THIS acceptor.

Parameters

Type $type

Return Value

bool

at line 98
Union setNullable(bool $state = true)

Returns a type that accepts both the current type and the given type.

Parameters

bool $state

Return Value

Union

at line 109
bool isNullable()

No description

Return Value

bool

at line 115
void __clone()

No description

Return Value

void