DataPropertyType
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
Create a new data property type.
Find the declared type accepted by a base type.
Determine if this declaration accepts the given type name.
Determine if this declaration accepts the given value.
Get the declared data object types.
Get the one unambiguous declared data object type.
Get the one unambiguous declared data object class.
Get the declared data collection types.
Get the one unambiguous declared data collection type.
Get the declared iterable types with item metadata.
Get the one unambiguous non-data iterable with item metadata.
Get the declared data collection and plain iterable container types.
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.
in
DataType at line 25
string|null
findAcceptedTypeForBaseType(string $class)
Find the declared type accepted by a base type.
in
DataType at line 33
bool
acceptsType(string $type)
Determine if this declaration accepts the given type name.
in
DataType at line 47
array
getNamedTypes()
Get every named type in declaration order.
in
DataType at line 55
bool
acceptsValue(mixed $value)
Determine if this declaration accepts the given value.
at line 141
array
getDataObjectTypes()
Get the declared data object types.
at line 149
NamedType|null
getDataObjectType()
Get the one unambiguous declared data object type.
at line 159
string|null
getDataObjectClass()
Get the one unambiguous declared data object class.
at line 169
array
getDataCollectableTypes()
Get the declared data collection types.
at line 177
NamedType|null
getDataCollectableType()
Get the one unambiguous declared data collection type.
at line 187
array
getIterableTypes()
Get the declared iterable types with item metadata.
at line 195
NamedType|null
getNonDataIterableType()
Get the one unambiguous non-data iterable with item metadata.
at line 205
array
getContainerTypes()
Get the declared data collection and plain iterable container types.
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.