abstract class CombinationType extends Type

Properties

protected NamedType> $namedTypes

The flattened named types in declaration order.

protected null|"array"|"bool"|"float"|"int"|"string" $singleBuiltinType

The one unambiguous built-in type.

Methods

bool
acceptsType(string $type)

Determine if this declaration accepts the given type name.

from  Type
bool
acceptsValue(mixed $value)

Determine if this declaration accepts the given value.

from  Type
bool
guaranteesType(string $type)

Determine if every value accepted by this declaration is an instance of the given type.

from  Type
string|null
findAcceptedTypeForBaseType(string $class)

Find the declared type accepted by a base type.

from  Type
array
getNamedTypes()

Get every named type in declaration order.

string|null
getSingleBuiltinType()

Get the one unambiguous built-in type in this declaration.

__construct(array $types)

Create a new combination type.

Details

in Type at line 12
abstract bool acceptsType(string $type)

Determine if this declaration accepts the given type name.

Parameters

string $type

Return Value

bool

in Type at line 17
abstract bool acceptsValue(mixed $value)

Determine if this declaration accepts the given value.

Parameters

mixed $value

Return Value

bool

in Type at line 22
abstract bool guaranteesType(string $type)

Determine if every value accepted by this declaration is an instance of the given type.

Parameters

string $type

Return Value

bool

in Type at line 27
abstract string|null findAcceptedTypeForBaseType(string $class)

Find the declared type accepted by a base type.

Parameters

string $class

Return Value

string|null

at line 56
array getNamedTypes()

Get every named type in declaration order.

Return Value

array

at line 66
string|null getSingleBuiltinType()

Get the one unambiguous built-in type in this declaration.

Return Value

string|null

at line 28
__construct(array $types)

Create a new combination type.

Parameters

array $types