Constants

BUILTIN_TYPE_INT

BUILTIN_TYPE_INT = 'int'

BUILTIN_TYPE_FLOAT

BUILTIN_TYPE_FLOAT = 'float'

BUILTIN_TYPE_STRING

BUILTIN_TYPE_STRING = 'string'

BUILTIN_TYPE_BOOL

BUILTIN_TYPE_BOOL = 'bool'

BUILTIN_TYPE_RESOURCE

BUILTIN_TYPE_RESOURCE = 'resource'

BUILTIN_TYPE_OBJECT

BUILTIN_TYPE_OBJECT = 'object'

BUILTIN_TYPE_ARRAY

BUILTIN_TYPE_ARRAY = 'array'

BUILTIN_TYPE_NULL

BUILTIN_TYPE_NULL = 'null'

BUILTIN_TYPE_CALLABLE

BUILTIN_TYPE_CALLABLE = 'callable'

BUILTIN_TYPE_ITERABLE

BUILTIN_TYPE_ITERABLE = 'iterable'

Properties

$builtinTypes

$builtinTypes : string[]

List of PHP builtin types.

Type

string[]

$builtinType

$builtinType

$nullable

$nullable

$class

$class

$collection

$collection

$collectionKeyType

$collectionKeyType

$collectionValueType

$collectionValueType

Methods

__construct()

__construct(string  $builtinType, bool  $nullable = false, string  $class = null, bool  $collection = false, self  $collectionKeyType = null, self  $collectionValueType = null) : mixed

Parameters

string $builtinType
bool $nullable
string $class
bool $collection
self $collectionKeyType
self $collectionValueType

Throws

\InvalidArgumentException

Returns

mixed —

getBuiltinType()

getBuiltinType() : string

Gets built-in type.

Can be bool, int, float, string, array, object, resource, null, callback or iterable.

Returns

string —

isNullable()

isNullable() : bool

Returns

bool —

getClassName()

getClassName() : ?string

Gets the class name.

Only applicable if the built-in type is object.

Returns

?string —

isCollection()

isCollection() : bool

Returns

bool —

getCollectionKeyType()

getCollectionKeyType() : ?self

Gets collection key type.

Only applicable for a collection type.

Returns

?self —

getCollectionValueType()

getCollectionValueType() : ?self

Gets collection value type.

Only applicable for a collection type.

Returns

?self —