class DataPropertyType extends DataType

Properties

protected NamedType> $dataObjectTypes

The declared data object types.

protected NamedType|null $dataObjectType
protected NamedType> $dataCollectableTypes

The declared data collection types.

protected NamedType|null $dataCollectableType
protected NamedType> $iterableTypes

The declared iterable types with item metadata.

protected NamedType|null $nonDataIterableType
protected NamedType> $containerTypes

The declared data collection and plain iterable container types.

bool $isUnion

Whether more than one declared type can hold a supplied value; null, Optional, and Lazy are not counted.

bool $hasContainerUnion

Whether more than one declared data collection or plain iterable type can hold an iterable value.

bool $isDataRelated

Whether a data object or data collection type is declared.

bool $recordsSelectedType

Whether creation records the declared type a value selects.

Methods

__construct(Type $type, bool $isOptional, bool $isNullable, bool $isMixed, string|null $lazyType)

Create a new data property type.

string|null
findAcceptedTypeForBaseType(string $class)

Find the declared type accepted by a base type.

from  DataType
bool
acceptsType(string $type)

Determine if this declaration accepts the given type name.

from  DataType
array
getNamedTypes()

Get every named type in declaration order.

from  DataType
bool
acceptsValue(mixed $value)

Determine if this declaration accepts the given value.

from  DataType
array
getDataObjectTypes()

Get the declared data object types.

NamedType|null
getDataObjectType()

Get the one unambiguous declared data object type.

string|null
getDataObjectClass()

Get the one unambiguous declared data object class.

array
getDataCollectableTypes()

Get the declared data collection types.

NamedType|null
getDataCollectableType()

Get the one unambiguous declared data collection type.

array
getIterableTypes()

Get the declared iterable types with item metadata.

NamedType|null
getNonDataIterableType()

Get the one unambiguous non-data iterable with item metadata.

array
getContainerTypes()

Get the declared data collection and plain iterable container types.

NamedType|null
acceptingContainerType(mixed $value)

Get the one declared container type whose container accepts a value.

Details

at line 77
__construct(Type $type, bool $isOptional, bool $isNullable, bool $isMixed, string|null $lazyType)

Create a new data property type.

Parameters

Type $type
bool $isOptional
bool $isNullable
bool $isMixed
string|null $lazyType

in DataType at line 25
string|null findAcceptedTypeForBaseType(string $class)

Find the declared type accepted by a base type.

Parameters

string $class

Return Value

string|null

in DataType at line 33
bool acceptsType(string $type)

Determine if this declaration accepts the given type name.

Parameters

string $type

Return Value

bool

in DataType at line 47
array getNamedTypes()

Get every named type in declaration order.

Return Value

array

in DataType at line 55
bool acceptsValue(mixed $value)

Determine if this declaration accepts the given value.

Parameters

mixed $value

Return Value

bool

at line 141
array getDataObjectTypes()

Get the declared data object types.

Return Value

array

at line 149
NamedType|null getDataObjectType()

Get the one unambiguous declared data object type.

Return Value

NamedType|null

at line 159
string|null getDataObjectClass()

Get the one unambiguous declared data object class.

Return Value

string|null

at line 169
array getDataCollectableTypes()

Get the declared data collection types.

Return Value

array

at line 177
NamedType|null getDataCollectableType()

Get the one unambiguous declared data collection type.

Return Value

NamedType|null

at line 187
array getIterableTypes()

Get the declared iterable types with item metadata.

Return Value

array

at line 195
NamedType|null getNonDataIterableType()

Get the one unambiguous non-data iterable with item metadata.

Return Value

NamedType|null

at line 205
array getContainerTypes()

Get the declared data collection and plain iterable container types.

Return Value

array

at line 215
NamedType|null acceptingContainerType(mixed $value)

Get the one declared container type whose container accepts a value.

Null means no container type accepts the value, or more than one does.

Parameters

mixed $value

Return Value

NamedType|null