Type
in package
AbstractYes
Table of Contents
Properties
- $array : Union|null
- $arrayAtomic : TArray|null
- $emptyArray : Union|null
- $emptyArrayAtomic : TArray|null
- $listKey : Union|null
- $listKeyFromDocblock : Union|null
Methods
- combineUnionTypeArray() : Union
- combineUnionTypes() : Union
- Combines two union types into one
- getArray() : Union
- getArrayAtomic() : TArray
- getArrayKey() : Union
- getAtomicStringFromLiteral() : TLiteralString|TNonEmptyString|TNonFalsyString
- getBool() : Union
- getClassString() : Union
- getClosure() : Union
- getEmptyArray() : Union
- getEmptyArrayAtomic() : TArray
- getFalse() : Union
- getFloat() : Union
- getFQCLNFromString() : string
- getInt() : Union
- getIntRange() : Union
- getList() : Union
- getListAtomic() : TKeyedArray
- getListKey() : Union
- getLiteral() : TLiteralString|TLiteralInt
- getLiteralClassString() : Union
- getLowercaseString() : Union
- getMixed() : Union
- getNever() : Union
- getNonEmptyList() : Union
- getNonEmptyListAtomic() : TKeyedArray
- getNonEmptyLowercaseString() : Union
- getNonEmptyString() : Union
- getNonFalsyString() : Union
- getNull() : Union
- getNumeric() : Union
- getNumericString() : Union
- getObject() : Union
- getResource() : Union
- getScalar() : Union
- getSingleLetter() : Union
- getString() : Union
- getStringFromFQCLN() : string
- getTrue() : Union
- getVoid() : Union
- intersectUnionTypes() : Union|null
- Combines two union types into one via an intersection
- isIntersectionType() : bool
- parseString() : Union
- Parses a string type representation
- hasIntersection() : bool
- intersectAtomicTypes() : Atomic|null
- mayHaveIntersection() : bool
Properties
$array
private
static Union|null
$array
= null
$arrayAtomic
private
static TArray|null
$arrayAtomic
= null
$emptyArray
private
static Union|null
$emptyArray
= null
$emptyArrayAtomic
private
static TArray|null
$emptyArrayAtomic
= null
$listKey
private
static Union|null
$listKey
= null
$listKeyFromDocblock
private
static Union|null
$listKeyFromDocblock
= null
Methods
combineUnionTypeArray()
public
static combineUnionTypeArray(array<int, Union> $union_types, Codebase|null $codebase) : Union
Parameters
Tags
Return values
UnioncombineUnionTypes()
Combines two union types into one
public
static combineUnionTypes(Union|null $type_1, Union|null $type_2[, Codebase|null $codebase = null ][, bool $overwrite_empty_array = false ][, bool $allow_mixed_union = true ][, int $literal_limit = 500 ][, bool|null $possibly_undefined = null ]) : Union
Parameters
- $type_1 : Union|null
- $type_2 : Union|null
- $codebase : Codebase|null = null
- $overwrite_empty_array : bool = false
- $allow_mixed_union : bool = true
- $literal_limit : int = 500
-
any greater number of literal types than this will be merged to a scalar
- $possibly_undefined : bool|null = null
Tags
Return values
UniongetArray()
public
static getArray() : Union
Tags
Return values
UniongetArrayAtomic()
public
static getArrayAtomic() : TArray
Tags
Return values
TArraygetArrayKey()
public
static getArrayKey([bool $from_docblock = false ]) : Union
Parameters
- $from_docblock : bool = false
Tags
Return values
UniongetAtomicStringFromLiteral()
public
static getAtomicStringFromLiteral(string $value[, bool $from_docblock = false ]) : TLiteralString|TNonEmptyString|TNonFalsyString
Parameters
- $value : string
- $from_docblock : bool = false
Return values
TLiteralString|TNonEmptyString|TNonFalsyStringgetBool()
public
static getBool([bool $from_docblock = false ]) : Union
Parameters
- $from_docblock : bool = false
Tags
Return values
UniongetClassString()
public
static getClassString([string $extends = 'object' ]) : Union
Parameters
- $extends : string = 'object'
Tags
Return values
UniongetClosure()
public
static getClosure() : Union
Tags
Return values
UniongetEmptyArray()
public
static getEmptyArray() : Union
Tags
Return values
UniongetEmptyArrayAtomic()
public
static getEmptyArrayAtomic() : TArray
Tags
Return values
TArraygetFalse()
public
static getFalse([bool $from_docblock = false ]) : Union
Parameters
- $from_docblock : bool = false
Tags
Return values
UniongetFloat()
public
static getFloat([float|null $value = null ][, bool $from_docblock = false ]) : Union
Parameters
- $value : float|null = null
- $from_docblock : bool = false
Tags
Return values
UniongetFQCLNFromString()
public
static getFQCLNFromString(string $class, Aliases $aliases) : string
Parameters
- $class : string
- $aliases : Aliases
Return values
stringgetInt()
public
static getInt([bool $from_calculation = false ][, int|null $value = null ]) : Union
Parameters
- $from_calculation : bool = false
- $value : int|null = null
Tags
Return values
UniongetIntRange()
public
static getIntRange(int|null $min, int|null $max) : Union
Parameters
- $min : int|null
- $max : int|null
Tags
Return values
UniongetList()
public
static getList([Union|null $of = null ][, bool $from_docblock = false ]) : Union
Parameters
- $of : Union|null = null
- $from_docblock : bool = false
Tags
Return values
UniongetListAtomic()
public
static getListAtomic(Union $of[, bool $from_docblock = false ]) : TKeyedArray
Parameters
- $of : Union
- $from_docblock : bool = false
Tags
Return values
TKeyedArraygetListKey()
public
static getListKey([bool $from_docblock = false ]) : Union
Parameters
- $from_docblock : bool = false
Tags
Return values
UniongetLiteral()
public
static getLiteral(int|string $value) : TLiteralString|TLiteralInt
Parameters
- $value : int|string
Tags
Return values
TLiteralString|TLiteralIntgetLiteralClassString()
public
static getLiteralClassString(string $class_type[, bool $definite_class = false ]) : Union
Parameters
- $class_type : string
- $definite_class : bool = false
Tags
Return values
UniongetLowercaseString()
public
static getLowercaseString() : Union
Tags
Return values
UniongetMixed()
public
static getMixed([bool $from_loop_isset = false ][, bool $from_docblock = false ]) : Union
Parameters
- $from_loop_isset : bool = false
- $from_docblock : bool = false
Tags
Return values
UniongetNever()
public
static getNever([bool $from_docblock = false ]) : Union
Parameters
- $from_docblock : bool = false
Tags
Return values
UniongetNonEmptyList()
public
static getNonEmptyList([Union|null $of = null ][, bool $from_docblock = false ]) : Union
Parameters
- $of : Union|null = null
- $from_docblock : bool = false
Tags
Return values
UniongetNonEmptyListAtomic()
public
static getNonEmptyListAtomic(Union $of[, bool $from_docblock = false ]) : TKeyedArray
Parameters
- $of : Union
- $from_docblock : bool = false
Tags
Return values
TKeyedArraygetNonEmptyLowercaseString()
public
static getNonEmptyLowercaseString() : Union
Tags
Return values
UniongetNonEmptyString()
public
static getNonEmptyString() : Union
Tags
Return values
UniongetNonFalsyString()
public
static getNonFalsyString() : Union
Tags
Return values
UniongetNull()
public
static getNull([bool $from_docblock = false ]) : Union
Parameters
- $from_docblock : bool = false
Tags
Return values
UniongetNumeric()
public
static getNumeric() : Union
Tags
Return values
UniongetNumericString()
public
static getNumericString() : Union
Tags
Return values
UniongetObject()
public
static getObject() : Union
Tags
Return values
UniongetResource()
public
static getResource([bool $from_docblock = false ]) : Union
Parameters
- $from_docblock : bool = false
Tags
Return values
UniongetScalar()
public
static getScalar([bool $from_docblock = false ]) : Union
Parameters
- $from_docblock : bool = false
Tags
Return values
UniongetSingleLetter()
public
static getSingleLetter() : Union
Tags
Return values
UniongetString()
public
static getString([string|null $value = null ]) : Union
Parameters
- $value : string|null = null
Return values
UniongetStringFromFQCLN()
public
static getStringFromFQCLN(string $value, string|null $namespace, array<lowercase-string, string> $aliased_classes, string|null $this_class[, bool $allow_self = false ][, bool $is_static = false ]) : string
Parameters
- $value : string
- $namespace : string|null
- $aliased_classes : array<lowercase-string, string>
- $this_class : string|null
- $allow_self : bool = false
- $is_static : bool = false
Tags
Return values
stringgetTrue()
public
static getTrue([bool $from_docblock = false ]) : Union
Parameters
- $from_docblock : bool = false
Tags
Return values
UniongetVoid()
public
static getVoid([bool $from_docblock = false ]) : Union
Parameters
- $from_docblock : bool = false
Tags
Return values
UnionintersectUnionTypes()
Combines two union types into one via an intersection
public
static intersectUnionTypes(Union|null $type_1, Union|null $type_2, Codebase $codebase[, bool $allow_interface_equality = false ][, bool $allow_float_int_equality = true ]) : Union|null
Parameters
- $type_1 : Union|null
- $type_2 : Union|null
- $codebase : Codebase
- $allow_interface_equality : bool = false
- $allow_float_int_equality : bool = true
Return values
Union|nullisIntersectionType()
public
static isIntersectionType(Atomic $type) : bool
Parameters
- $type : Atomic
Tags
Return values
boolparseString()
Parses a string type representation
public
static parseString(string $type_string[, int|null $analysis_php_version_id = null ][, array<string, array<string, Union>> $template_type_map = [] ]) : Union
Parameters
- $type_string : string
- $analysis_php_version_id : int|null = null
- $template_type_map : array<string, array<string, Union>> = []
Return values
UnionhasIntersection()
private
static hasIntersection(Atomic $type) : bool
Parameters
- $type : Atomic
Return values
boolintersectAtomicTypes()
private
static intersectAtomicTypes(Atomic $type_1_atomic, Atomic $type_2_atomic, Codebase $codebase, bool &$intersection_performed[, bool $allow_interface_equality = false ][, bool $allow_float_int_equality = true ]) : Atomic|null
Parameters
- $type_1_atomic : Atomic
- $type_2_atomic : Atomic
- $codebase : Codebase
- $intersection_performed : bool
- $allow_interface_equality : bool = false
- $allow_float_int_equality : bool = true
Return values
Atomic|nullmayHaveIntersection()
private
static mayHaveIntersection(Atomic $type, Codebase $codebase) : bool