Type
class Type
Type value object (immutable).
Constants
BUILTIN_TYPE_INT |
|
BUILTIN_TYPE_FLOAT |
|
BUILTIN_TYPE_STRING |
|
BUILTIN_TYPE_BOOL |
|
BUILTIN_TYPE_RESOURCE |
|
BUILTIN_TYPE_OBJECT |
|
BUILTIN_TYPE_ARRAY |
|
BUILTIN_TYPE_NULL |
|
BUILTIN_TYPE_CALLABLE |
|
Properties
static string[] | $builtinTypes | List of PHP builtin types. |
Methods
__construct(string $builtinType, bool $nullable = false, string|null $class = null, bool $collection = false, Type $collectionKeyType = null, Type $collectionValueType = null)
No description
string
getBuiltinType()
Gets built-in type.
bool
isNullable()
Allows null value?
string|null
getClassName()
Gets the class name.
bool
isCollection()
Is collection?
Type|null
getCollectionKeyType()
Gets collection key type.
Type|null
getCollectionValueType()
Gets collection value type.
Details
at line line 88
__construct(string $builtinType, bool $nullable = false, string|null $class = null, bool $collection = false, Type $collectionKeyType = null, Type $collectionValueType = null)
at line line 109
string
getBuiltinType()
Gets built-in type.
Can be bool, int, float, string, array, object, resource, null or callback.
at line line 119
bool
isNullable()
Allows null value?
at line line 131
string|null
getClassName()
Gets the class name.
Only applicable if the built-in type is object.
at line line 141
bool
isCollection()
Is collection?
at line line 153
Type|null
getCollectionKeyType()
Gets collection key type.
Only applicable for a collection type.
at line line 165
Type|null
getCollectionValueType()
Gets collection value type.
Only applicable for a collection type.