Documentation

Type
in package

FinalYes
Tags
psalm-type

TypeEnum = Type::TYPE_*

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
bool

arrayOf()

public static arrayOf(string $class) : self
Parameters
$class : string
Return values
self

fromReflectionClass()

public static fromReflectionClass(ReflectionClass $class[, bool $nullable = false ]) : Type
Parameters
$class : ReflectionClass
$nullable : bool = false
Return values
Type

fromReflectionType()

public static fromReflectionType(ReflectionType $type) : Type
Parameters
$type : ReflectionType
Return values
Type

getName()

public getName() : string
Return values
string

isArrayOf()

public isArrayOf() : bool
Return values
bool

isClass()

public isClass() : bool
Return values
bool

isUntyped()

public isUntyped() : bool
Return values
bool

        
On this page

Search results