Documentation

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

$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
$union_types : array<int, Union>
$codebase : Codebase|null
Tags
psalm-external-mutation-free
Return values
Union

combineUnionTypes()

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
psalm-external-mutation-free
psalm-suppress

ImpurePropertyAssignment We're not mutating external instances

psalm-suppress

InaccessibleProperty We're not mutating external instances

Return values
Union

getArray()

public static getArray() : Union
Tags
psalm-pure
psalm-suppress

ImpureStaticProperty Used for caching

Return values
Union

getArrayAtomic()

public static getArrayAtomic() : TArray
Tags
psalm-pure
psalm-suppress

ImpureStaticProperty Used for caching

Return values
TArray

getArrayKey()

public static getArrayKey([bool $from_docblock = false ]) : Union
Parameters
$from_docblock : bool = false
Tags
psalm-pure
Return values
Union

getBool()

public static getBool([bool $from_docblock = false ]) : Union
Parameters
$from_docblock : bool = false
Tags
psalm-pure
Return values
Union

getClassString()

public static getClassString([string $extends = 'object' ]) : Union
Parameters
$extends : string = 'object'
Tags
psalm-pure
Return values
Union

getClosure()

public static getClosure() : Union
Tags
psalm-pure
Return values
Union

getEmptyArray()

public static getEmptyArray() : Union
Tags
psalm-pure
psalm-suppress

ImpureStaticProperty Used for caching

Return values
Union

getEmptyArrayAtomic()

public static getEmptyArrayAtomic() : TArray
Tags
psalm-pure
psalm-suppress

ImpureStaticProperty Used for caching

Return values
TArray

getFalse()

public static getFalse([bool $from_docblock = false ]) : Union
Parameters
$from_docblock : bool = false
Tags
psalm-pure
Return values
Union

getFloat()

public static getFloat([float|null $value = null ][, bool $from_docblock = false ]) : Union
Parameters
$value : float|null = null
$from_docblock : bool = false
Tags
psalm-pure
Return values
Union

getFQCLNFromString()

public static getFQCLNFromString(string $class, Aliases $aliases) : string
Parameters
$class : string
$aliases : Aliases
Return values
string

getInt()

public static getInt([bool $from_calculation = false ][, int|null $value = null ]) : Union
Parameters
$from_calculation : bool = false
$value : int|null = null
Tags
psalm-pure
Return values
Union

getIntRange()

public static getIntRange(int|null $min, int|null $max) : Union
Parameters
$min : int|null
$max : int|null
Tags
psalm-pure
Return values
Union

getList()

public static getList([Union|null $of = null ][, bool $from_docblock = false ]) : Union
Parameters
$of : Union|null = null
$from_docblock : bool = false
Tags
psalm-pure
Return values
Union

getListAtomic()

public static getListAtomic(Union $of[, bool $from_docblock = false ]) : TKeyedArray
Parameters
$of : Union
$from_docblock : bool = false
Tags
psalm-pure
Return values
TKeyedArray

getListKey()

public static getListKey([bool $from_docblock = false ]) : Union
Parameters
$from_docblock : bool = false
Tags
psalm-pure
psalm-suppress

ImpureStaticProperty Used for caching

Return values
Union

getLiteralClassString()

public static getLiteralClassString(string $class_type[, bool $definite_class = false ]) : Union
Parameters
$class_type : string
$definite_class : bool = false
Tags
psalm-pure
Return values
Union

getLowercaseString()

public static getLowercaseString() : Union
Tags
psalm-pure
Return values
Union

getMixed()

public static getMixed([bool $from_loop_isset = false ][, bool $from_docblock = false ]) : Union
Parameters
$from_loop_isset : bool = false
$from_docblock : bool = false
Tags
psalm-pure
Return values
Union

getNever()

public static getNever([bool $from_docblock = false ]) : Union
Parameters
$from_docblock : bool = false
Tags
psalm-pure
Return values
Union

getNonEmptyList()

public static getNonEmptyList([Union|null $of = null ][, bool $from_docblock = false ]) : Union
Parameters
$of : Union|null = null
$from_docblock : bool = false
Tags
psalm-pure
Return values
Union

getNonEmptyListAtomic()

public static getNonEmptyListAtomic(Union $of[, bool $from_docblock = false ]) : TKeyedArray
Parameters
$of : Union
$from_docblock : bool = false
Tags
psalm-pure
Return values
TKeyedArray

getNonEmptyLowercaseString()

public static getNonEmptyLowercaseString() : Union
Tags
psalm-pure
Return values
Union

getNonEmptyString()

public static getNonEmptyString() : Union
Tags
psalm-pure
Return values
Union

getNonFalsyString()

public static getNonFalsyString() : Union
Tags
psalm-pure
Return values
Union

getNull()

public static getNull([bool $from_docblock = false ]) : Union
Parameters
$from_docblock : bool = false
Tags
psalm-pure
Return values
Union

getNumeric()

public static getNumeric() : Union
Tags
psalm-pure
Return values
Union

getNumericString()

public static getNumericString() : Union
Tags
psalm-pure
Return values
Union

getObject()

public static getObject() : Union
Tags
psalm-pure
Return values
Union

getResource()

public static getResource([bool $from_docblock = false ]) : Union
Parameters
$from_docblock : bool = false
Tags
psalm-pure
Return values
Union

getScalar()

public static getScalar([bool $from_docblock = false ]) : Union
Parameters
$from_docblock : bool = false
Tags
psalm-pure
Return values
Union

getSingleLetter()

public static getSingleLetter() : Union
Tags
psalm-pure
Return values
Union

getString()

public static getString([string|null $value = null ]) : Union
Parameters
$value : string|null = null
Return values
Union

getStringFromFQCLN()

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
psalm-pure
Return values
string

getTrue()

public static getTrue([bool $from_docblock = false ]) : Union
Parameters
$from_docblock : bool = false
Tags
psalm-pure
Return values
Union

getVoid()

public static getVoid([bool $from_docblock = false ]) : Union
Parameters
$from_docblock : bool = false
Tags
psalm-pure
Return values
Union

intersectUnionTypes()

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|null

isIntersectionType()

public static isIntersectionType(Atomic $type) : bool
Parameters
$type : Atomic
Tags
psalm-assert-if-true

TNamedObject|TTemplateParam|TIterable|TObjectWithProperties|TCallableObject $type

Return values
bool

parseString()

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
Union

hasIntersection()

private static hasIntersection(Atomic $type) : bool
Parameters
$type : Atomic
Return values
bool

intersectAtomicTypes()

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|null

mayHaveIntersection()

private static mayHaveIntersection(Atomic $type, Codebase $codebase) : bool
Parameters
$type : Atomic
$codebase : Codebase
Tags
psalm-assert-if-true

TIterable|TNamedObject|TTemplateParam|TObjectWithProperties $type

Return values
bool

        
On this page

Search results