Method | Description | |
---|---|---|
__clone ( ) : null | After a clone is called on this object, clone our deep objects. | |
__construct ( |
||
__construct ( |
||
__toString ( ) : string | ||
addType ( |
Add a type name to the list of types | |
addType ( |
Add a type name to the list of types | |
addUnionType ( |
Add the given types to this type | |
asClassList ( |
||
asExpandedTypes ( |
||
asGenericArrayTypes ( ) : |
||
canCastToExpandedUnionType ( |
||
canCastToUnionType ( |
||
fromFullyQualifiedString ( string $fully_qualified_string ) : |
||
fromNode ( |
||
fromStringInContext ( string $type_string, |
||
genericArrayElementTypes ( ) : |
Takes "a|b[]|c|d[]|e" and returns "b|d" | |
getTemplateParameterTypeList ( ) : array | ||
getTemplateParameterTypeMap ( |
||
getTypeSet ( ) : Phan\Library\Set | ||
hasAnyType ( array $type_list ) : boolean | ||
hasArrayLike ( ) : boolean | ||
hasGenericArray ( ) : boolean | ||
hasSelfType ( ) : boolean | ||
hasStaticType ( ) : boolean | ||
hasTemplateType ( ) : boolean | ||
hasType ( |
||
hasType ( |
||
internalFunctionSignatureMap ( ) : array | ||
internalFunctionSignatureMapForFQSEN ( |
A list of types for parameters associated with the given builtin function with the given name | |
internalPropertyMapForClassName ( string $class_name ) : array | ||
isEmpty ( ) : boolean | ||
isEqualTo ( |
||
isGenericArray ( ) : boolean | ||
isNativeType ( ) : boolean | ||
isScalar ( ) : boolean | ||
isType ( |
||
isType ( |
||
nonArrayTypes ( ) : |
Takes "a|b[]|c|d[]|e|array|ArrayAccess" and returns "a|c|e|ArrayAccess" | |
nonGenericArrayTypes ( ) : |
Takes "a|b[]|c|d[]|e" and returns "a|c|e" | |
nonNativeTypes ( ) : |
||
removeType ( |
Remove a type name to the list of types | |
removeType ( |
Remove a type name to the list of types | |
serialize ( ) : string | As per the Serializable interface | |
typeCount ( ) : integer | ||
unserialize ( string $serialized ) : void | As per the Serializable interface | |
withStaticResolvedInContext ( |
||
withTemplateParameterTypeMap ( array $template_parameter_type_map ) : |
Method | Description | |
---|---|---|
hasGenericType ( ) : boolean | ||
internalPropertyMap ( ) : array |
public __construct ( |
||
$type_list | An optional list of types represented by this union |
public __construct ( |
||
$type_list | An optional list of types represented by this union |
public __toString ( ) : string | ||
return | string | A human-readable string representation of this union type |
public addUnionType ( |
||
$union_type | ||
return | null |
public asClassList ( |
||
$code_base | The code base in which to find classes | |
$context | The context in which we're resolving this union type. | |
return | Generator | |
A list of classes representing the non-native types associated with this UnionType |
public asExpandedTypes ( |
||
$code_base | ||
$recursion_depth | integer | This thing has a tendency to run-away on me. This tracks how bad I messed up by seeing how far the expanded types go |
return | Expands all class types to all inherited classes returning a superset of this type. |
public asGenericArrayTypes ( ) : |
||
return | Get a new type for each type in this union which is the generic array version of this type. For instance, 'int|float' will produce 'int[]|float[]'. |
public canCastToExpandedUnionType ( |
||
$target | The type we'd like to see if this type can cast to | |
$code_base | The code base used to expand types | |
return | boolean | Test to see if this type can be cast to the given type after expanding both union types to include all ancestor types |
public canCastToUnionType ( |
||
$target | A type to check to see if this can cast to it | |
return | boolean | True if this type is allowed to cast to the given type i.e. int->float is allowed while float->int is not. |
public static fromFullyQualifiedString ( string $fully_qualified_string ) : |
||
$fully_qualified_string | string | A '|' delimited string representing a type in the form 'int|string|null|ClassName'. |
return |
public static fromNode ( |
||
$context | The context of the parser at the node for which we'd like to determine a type | |
$code_base | The code base within which we're operating | |
$node | ast\Node | string | null | The node for which we'd like to determine its type |
$should_catch_issue_exception | boolean | Set to true to cause loggable issues to be thrown instead of emitted as issues to the log. |
return |
public static fromStringInContext ( string $type_string, |
||
$type_string | string | A '|' delimited string representing a type in the form 'int|string|null|ClassName'. |
$context | The context in which the type string was found | |
return |
public genericArrayElementTypes ( ) : |
||
return | The subset of types in this |
public getTemplateParameterTypeList ( ) : array | ||
return | array | A map from template type identifiers to the UnionType to replace it with |
public getTemplateParameterTypeMap ( |
||
$code_base | The code base to look up classes against | |
return | array | A map from template type identifiers to the UnionType to replace it with |
public getTypeSet ( ) : Phan\Library\Set | ||
return | Phan\Library\Set | The set of simple types associated with this union type. |
public hasAnyType ( array $type_list ) : boolean | ||
$type_list | array | A list of types |
return | boolean | True if this union type contains any of the given named types |
public hasArrayLike ( ) : boolean | ||
return | boolean | True if this union has array-like types (is of type array, is a generic array, or implements ArrayAccess). |
public hasGenericArray ( ) : boolean | ||
return | boolean | True if this type has any generic types |
public hasSelfType ( ) : boolean | ||
return | boolean | True if this type has a type referencing the class context in which it exists such as 'self' or '$this' |
public hasStaticType ( ) : boolean | ||
return | boolean | True if this type has a type referencing the class context 'static'. |
public hasTemplateType ( ) : boolean | ||
return | boolean | True if this union type has any types that are generic types |
public static internalFunctionSignatureMap ( ) : array | ||
return | array | A map from builtin function name to type information |
public static internalFunctionSignatureMapForFQSEN ( |
||
$function_fqsen | ||
return | array |
public static internalPropertyMapForClassName ( string $class_name ) : array | ||
$class_name | string | |
return | array | Get a map from property name to its type for the given class name. |
public isGenericArray ( ) : boolean | ||
return | boolean | True if this is exclusively generic types |
public isNativeType ( ) : boolean | ||
return | boolean | True if this UnionType is exclusively native types |
public nonArrayTypes ( ) : |
||
return | A UnionType with generic types(as well as the non-generic type "array") filtered out. |
public nonGenericArrayTypes ( ) : |
||
return | A UnionType with generic types filtered out |
public nonNativeTypes ( ) : |
||
return | Get the subset of types which are not native |
public removeType ( |
||
$type | ||
return | void |
public removeType ( |
||
$type | ||
return | void |
public unserialize ( string $serialized ) : void | ||
$serialized | string | A serialized UnionType |
return | void |
public withStaticResolvedInContext ( |
||
$context | ||
return | A new UnionType with any references to 'static' resolved in the given context. |
public withTemplateParameterTypeMap ( array $template_parameter_type_map ) : |
||
$template_parameter_type_map | array | A map from template type identifiers to concrete types |
return | This UnionType with any template types contained herein mapped to concrete types defined in the given map. |