Type
in package
FinalYes
Tags
Table of Contents
Constants
- TYPE_ANY = 'mixed'
- TYPE_ARRAY = 'array'
- TYPE_BOOL = 'bool'
- TYPE_FALSE = 'false'
- TYPE_FLOAT = 'float'
- TYPE_INT = 'int'
- TYPE_NULL = 'null'
- TYPE_OBJECT = 'object'
- TYPE_STRING = 'string'
- TYPE_TRUE = 'true'
- TYPE_VOID = 'void'
Properties
- $allowsNull : bool
- $isArrayOf : bool
- $name : string
Methods
- __construct() : mixed
- allowsNull() : bool
- arrayOf() : self
- create() : Type
- fromReflectionClass() : Type
- fromReflectionType() : Type
- getName() : string
- isArrayOf() : bool
- isClass() : bool
- isUntyped() : bool
Constants
TYPE_ANY
public
mixed
TYPE_ANY
= 'mixed'
TYPE_ARRAY
public
mixed
TYPE_ARRAY
= 'array'
TYPE_BOOL
public
mixed
TYPE_BOOL
= 'bool'
TYPE_FALSE
public
mixed
TYPE_FALSE
= 'false'
TYPE_FLOAT
public
mixed
TYPE_FLOAT
= 'float'
TYPE_INT
public
mixed
TYPE_INT
= 'int'
TYPE_NULL
public
mixed
TYPE_NULL
= 'null'
TYPE_OBJECT
public
mixed
TYPE_OBJECT
= 'object'
TYPE_STRING
public
mixed
TYPE_STRING
= 'string'
TYPE_TRUE
public
mixed
TYPE_TRUE
= 'true'
TYPE_VOID
public
mixed
TYPE_VOID
= 'void'
Properties
$allowsNull read-only
private
bool
$allowsNull
$isArrayOf read-only
private
bool
$isArrayOf
= false
$name read-only
private
string
$name
= Type::TYPE_ANY
Methods
__construct()
public
__construct([TypeEnum|string $name = Type::TYPE_ANY ][, bool|null $allowsNull = null ][, bool $isArrayOf = false ]) : mixed
Parameters
- $name : TypeEnum|string = Type::TYPE_ANY
- $allowsNull : bool|null = null
- $isArrayOf : bool = false
allowsNull()
public
allowsNull() : bool
Return values
boolarrayOf()
public
static arrayOf(string $class) : self
Parameters
- $class : string
Return values
selfcreate()
public
static create(string|ReflectionClass|ReflectionType|Type|ReturnType $type) : Type
Parameters
- $type : string|ReflectionClass|ReflectionType|Type|ReturnType
Return values
TypefromReflectionClass()
public
static fromReflectionClass(ReflectionClass $class[, bool $nullable = false ]) : Type
Parameters
- $class : ReflectionClass
- $nullable : bool = false
Return values
TypefromReflectionType()
public
static fromReflectionType(ReflectionType $type) : Type
Parameters
- $type : ReflectionType
Return values
TypegetName()
public
getName() : string
Return values
stringisArrayOf()
public
isArrayOf() : bool
Return values
boolisClass()
public
isClass() : bool
Return values
boolisUntyped()
public
isUntyped() : bool