Type
in package
Type value object (immutable).
Tags
Table of Contents
- BUILTIN_TYPE_ARRAY = 'array'
- BUILTIN_TYPE_BOOL = 'bool'
- BUILTIN_TYPE_CALLABLE = 'callable'
- BUILTIN_TYPE_FLOAT = 'float'
- BUILTIN_TYPE_INT = 'int'
- BUILTIN_TYPE_ITERABLE = 'iterable'
- BUILTIN_TYPE_NULL = 'null'
- BUILTIN_TYPE_OBJECT = 'object'
- BUILTIN_TYPE_RESOURCE = 'resource'
- BUILTIN_TYPE_STRING = 'string'
- $builtinTypes : array<string|int, string>
- List of PHP builtin types.
- $builtinType : mixed
- $class : mixed
- $collection : mixed
- $collectionKeyType : mixed
- $collectionValueType : mixed
- $nullable : mixed
- __construct() : mixed
- getBuiltinType() : string
- Gets built-in type.
- getClassName() : string|null
- Gets the class name.
- getCollectionKeyType() : self|null
- Gets collection key type.
- getCollectionValueType() : self|null
- Gets collection value type.
- isCollection() : bool
- isNullable() : bool
Constants
BUILTIN_TYPE_ARRAY
public
mixed
BUILTIN_TYPE_ARRAY
= 'array'
BUILTIN_TYPE_BOOL
public
mixed
BUILTIN_TYPE_BOOL
= 'bool'
BUILTIN_TYPE_CALLABLE
public
mixed
BUILTIN_TYPE_CALLABLE
= 'callable'
BUILTIN_TYPE_FLOAT
public
mixed
BUILTIN_TYPE_FLOAT
= 'float'
BUILTIN_TYPE_INT
public
mixed
BUILTIN_TYPE_INT
= 'int'
BUILTIN_TYPE_ITERABLE
public
mixed
BUILTIN_TYPE_ITERABLE
= 'iterable'
BUILTIN_TYPE_NULL
public
mixed
BUILTIN_TYPE_NULL
= 'null'
BUILTIN_TYPE_OBJECT
public
mixed
BUILTIN_TYPE_OBJECT
= 'object'
BUILTIN_TYPE_RESOURCE
public
mixed
BUILTIN_TYPE_RESOURCE
= 'resource'
BUILTIN_TYPE_STRING
public
mixed
BUILTIN_TYPE_STRING
= 'string'
Properties
$builtinTypes
List of PHP builtin types.
public
static array<string|int, string>
$builtinTypes
= [self::BUILTIN_TYPE_INT, self::BUILTIN_TYPE_FLOAT, self::BUILTIN_TYPE_STRING, self::BUILTIN_TYPE_BOOL, self::BUILTIN_TYPE_RESOURCE, self::BUILTIN_TYPE_OBJECT, self::BUILTIN_TYPE_ARRAY, self::BUILTIN_TYPE_CALLABLE, self::BUILTIN_TYPE_NULL, self::BUILTIN_TYPE_ITERABLE]
$builtinType
private
mixed
$builtinType
$class
private
mixed
$class
$collection
private
mixed
$collection
$collectionKeyType
private
mixed
$collectionKeyType
$collectionValueType
private
mixed
$collectionValueType
$nullable
private
mixed
$nullable
Methods
__construct()
public
__construct(string $builtinType[, bool $nullable = false ][, string $class = null ][, bool $collection = false ][, self $collectionKeyType = null ][, self $collectionValueType = null ]) : mixed
Parameters
- $builtinType : string
- $nullable : bool = false
- $class : string = null
- $collection : bool = false
- $collectionKeyType : self = null
- $collectionValueType : self = null
Tags
Return values
mixed —getBuiltinType()
Gets built-in type.
public
getBuiltinType() : string
Can be bool, int, float, string, array, object, resource, null, callback or iterable.
Return values
string —getClassName()
Gets the class name.
public
getClassName() : string|null
Only applicable if the built-in type is object.
Return values
string|null —getCollectionKeyType()
Gets collection key type.
public
getCollectionKeyType() : self|null
Only applicable for a collection type.
Return values
self|null —getCollectionValueType()
Gets collection value type.
public
getCollectionValueType() : self|null
Only applicable for a collection type.
Return values
self|null —isCollection()
public
isCollection() : bool
Return values
bool —isNullable()
public
isNullable() : bool